Hello,
I’m trying to set up my config such that:
1 - if super_l is pressed then other keys pressed… then popup various menus
2 - if super_l is pressed then released with no other keys pressed… then popup a different menu
Bindings for the first case are normal.
The second I’m finding hard: the closest I seem to have come is a convoluted loop of scheduling and testing as per the sample below.
But this only detects another meta key being pressed while super_l was held, not any arbitrary key.
And it gives odd functionality to F12!
One option that occurs is to call SuperTestOff on every key binding that uses super_l as one of the meta keys. But that’s really kludgy.
Better would be some way of registering a callback for any keypress event, and in that handler call SuperTestOff. Is such a thing possble (I’ve not come across it in the man pages etc).
Or alternatively is there a better way to achieve my goal??
What would be really nice is something like
Key Super_L A N (OnRelease NoOtherKeyPressed) Menu "StartMenu" Nop
My current convoluted partial mechanism:
DestroyFunc SuperPress
AddToFunc SuperPress
+ I Echo in SuperPress
+ I SuperTest
DestroyFunc SuperDepress
AddToFunc SuperDepress
+ I Echo in SuperDepress
+ I Deschedule 10
+ I Menu "StartMenu" Nop
DestroyFunc SuperTestOff
AddToFunc SuperTestOff
+ I Echo in SuperTestOff
+ I Deschedule 10
DestroyFunc SuperTest
AddToFunc SuperTest
+ I Echo in SuperTest
+ I NoWindow FakeKeypress depth 1 press F12
+ I Deschedule 10
+ I Schedule 50 10 SuperTest
Key Super_L A A SuperPress
# Fake keys to handle Super press / release (super is meta 4 here)
# NB order important as last overrides first
Key F12 A A SuperTestOff # another meta pressed - stop
Key F12 A N SuperDepress # released on its own
Key F12 A 4 Nop # still pressed - carry on testing
thanks,
g.