How can I set an action to occur on a key release in xmonad?
I don't like menu bars and panels. Instead of a panel like xmobar I want to have a full screen page of info, (time, currently selected window and workspace etc) appear when I hold down a key combo and then vanish when I let the keys go. I could code the info page application myself. I can set the info page to spawn on a key press.
I can not set anything to happen on a key release.
How can I set an action to occur on a key release?
I am considering extending xmonad myself to do this. I hope I don't have to though because it'd be really annoying.
The above is an example. Do take note that a 'key release' could occur with a modifier key (
ev_state
).XMonad passes all received events, including KeyPress events, to the
handleEventHook
, so this code would be able to react onkeyRelease
events:You would use it like that in your xmonad.hs file:
Unfortunately, this does not work yet: It will only react on
KeyRelease
events that have a corresponding entry in the regularkeys
configuration. This is due tograyKeys
inXMonad.Main
, grabbing only keys mentioned inkeys
. You can work-around this by defining a dummy action for every combination that you want to handle inKeyUp
: