Piotr> I'd like to have the FvwmButtons window raised when Super_L is
Piotr> pressed, and lowered when it's not.
Scott> If you're trying to keep your buttonbar on top of all your
Scott> xterms etc, you may want to try the 'StaysOnTop' style or try
Scott> an autohiding buttonbar like I do.
For lowering FvwmButtons (almost) exactly when Super_L is released,
I came up with the following solution.
DestroyFunc RaiseBar
AddToFunc RaiseBar
+ I Next (FvwmButtons) Layer 0 6
DestroyFunc LowerBar
AddToFunc LowerBar
+ I Next (FvwmButtons) Layer 0 2
DestroyFunc SuperPress
AddToFunc SuperPress
+ I RaiseBar
+ I SuperTest
DestroyFunc SuperTest
AddToFunc SuperTest
+ I NoWindow FakeKeypress depth 1 press F12
+ I Schedule 50 10 SuperTest
DestroyFunc SuperDepress
AddToFunc SuperDepress
+ I LowerBar
+ I Deschedule 10 # 10-> periodic testing for super
Key Super_L A A SuperPress
Key F12 A N SuperDepress
Basically, when Super_L has been pressed, this code moves FvwmButtons
to Layer 6 (top), and start testing (every 50ms) whether Super_L is
still pressed. When it's not, FvwmButtons is moved back to Layer 2
(bottom). The only way of testing I could come up with was sending a
fake keypress even and intercepting it if no modifiers are used. Is
there a better way?
By the way, the NoWindow modifier in SuperTest is necessary. I'm not
sure why.
I'm a bit worried about using the Schedule command here. The manual
says that the scheduled command is executed in the same window
context. How is this implemented? My experiments show that even if
scheduled with a very long delay, a command is executed immediately
when I move the mouse pointer out of the window. Therefore, I'm
surprised (positively) that the above code does not generate an
infinite loop (that would hang fvwm) when I move the mouse pointer
from one window to another while Super_L is pressed.
Scott> I recently implemented a patch to allow window-specific
Scott> key-bindings (to avoid problems like these), hopefully it will
Scott> be added to FVWM soon.
Cool.
Thanks,
Piotr
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Mar 23 2004 - 11:00:26 GMT