(Solved) F11 in Gtkdialog GUI?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
ITSMERSH

(Solved) F11 in Gtkdialog GUI?

#1 Post by ITSMERSH »

Hi.

Using keyboard F11 usually makes a window sized full screen and revert.

I would like to add this to my program (GUI made with gtkdialog).

How to achieve? Is this possible?
Last edited by ITSMERSH on Mon 19 Nov 2018, 00:00, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#2 Post by MochiMoppel »

Requires wmctrl:

Code: Select all

#!/bin/bash
echo '<window>
<text label="F11 toggles fullscreen"></text>
<action signal="key-press-event">[ $KEY_SYM = F11 ] && wmctrl -r :ACTIVE: -b toggle,fullscreen</action>
</window>'|gtkdialog -s

ITSMERSH

#3 Post by ITSMERSH »

Thank you MochiMoppel.

You're an expert for real! :D

I have wmctrl installed in all my Puppies (32 & 64), since I'm using it for different stuff like a script waiting after booting until a specific window appears on the screen. Then switching the desktop to my favorite selection of programs and executing the creation of lots of symbolic links etc.pp.

The wmctrl is pretty cool and some more easy to use than xdotool which I have also installed in all my Puppies.

Edit:

Copied <action signal="key-press-event">[ $KEY_SYM = F11 ] && wmctrl -r :ACTIVE: -b toggle,fullscreen</action> and pasted into my script. Works immediately! :D

ITSMERSH

#4 Post by ITSMERSH »

Added <action signal="key-press-event">[ $KEY_SYM = F12 ] && wmctrl -r :ACTIVE: -b toggle,shaded</action> to roll up / roll down the window. Works also immediately!

Thanks again! :D

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#5 Post by MochiMoppel »

ITSMERSH wrote:Added <action signal="key-press-event">[ $KEY_SYM = F12 ] && wmctrl -r :ACTIVE: -b toggle,shaded</action> to roll up / roll down the window. Works also immediately!
:shock: It works?
1) If used as in my example "shaded" can't be toggled. Here shaded (and minimized) windows do not respond to signals and can not unshade themselves.

2) In most Puppies the F12 key is bound to the JWM menu and has priority over assignments in gtkdialog or any other application.
I tried in vain to argue against it a couple of times. Unfortunately this strange configuration is present in even the most recent Puppies :cry:

ITSMERSH

#6 Post by ITSMERSH »

Yes, both keyboard shortcuts do work - as long as the window is the active one on top!

I have tried F10 first but this opens the Menu of my gtkdialog (gtkdialog 0.8.4) program.

Also, I have Openbox and LxPanel installed. I prever Openbox since the Days of Lucid 528 instead of JWM (never liked JWM really, though I found it easier to modify - at least the versions of the Woof Puppies (WoofCE did change a lot on JWM's Menus and how it is built)).

Post Reply