Configure eating of keys based on window class

Hi, would it be possible to configure xmonad to eat certain keys or key combinations to windows based on some predicate (window className) or globaly? I have tried to define this globaly by adding the following line to my keybindings: ((0, xK_Super_L), return ()) (As explained in https://mail.haskell.org/pipermail/xmonad/2012-February/012402.html) But this does not appear to work (key is still processed in the active window) Thanks a lot for any thoughts.

On Mon, Feb 16, 2015 at 8:27 AM, Jiří Maršíček
I have tried to define this globaly by adding the following line to my keybindings:
((0, xK_Super_L), return ())
(As explained in https://mail.haskell.org/pipermail/xmonad/2012-February/012402.html
)
But this does not appear to work (key is still processed in the active window)
That would only work if vbox isn't already grabbing the keyboard, for starters. I also suspect it won't work in some circumstances (if the program is using the RECORD extension to watch for keys, or if the trigger is modifier+normal key then it won't see the modifier press but it will still show up in the modifier bitmask when the normal key is pressed). Could you explain the actual problem you're trying to fix? -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Hi Brandon,
thanks a lot for looking into this.
I am using Citrix ICA Client to connect to remote Windows machine.
I use Super_L key as meta modifier and when I press any key combinations
containing this modifier it is also passed to the Windows session in the
Citrix session resulting in opening the Start menu.
Now as I am thinking about it - maybe it might be enough just to change the
Super_L modifier to something else that Windows do not recognize. Is it
possible to change the keycode of the Win Key to something unused (by using
xmodmap) and then define it as meta key in xmonad?
On Mon, Feb 16, 2015 at 3:41 PM, Brandon Allbery
On Mon, Feb 16, 2015 at 8:27 AM, Jiří Maršíček
wrote: I have tried to define this globaly by adding the following line to my keybindings:
((0, xK_Super_L), return ())
(As explained in https://mail.haskell.org/pipermail/xmonad/2012-February/012402.html
)
But this does not appear to work (key is still processed in the active window)
That would only work if vbox isn't already grabbing the keyboard, for starters. I also suspect it won't work in some circumstances (if the program is using the RECORD extension to watch for keys, or if the trigger is modifier+normal key then it won't see the modifier press but it will still show up in the modifier bitmask when the normal key is pressed).
Could you explain the actual problem you're trying to fix?
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Mon, Feb 16, 2015 at 9:53 AM, Jiří Maršíček
Now as I am thinking about it - maybe it might be enough just to change the Super_L modifier to something else that Windows do not recognize. Is it possible to change the keycode of the Win Key to something unused (by using xmodmap) and then define it as meta key in xmonad?
Keycodes are hardcoded in the X server and can't be changed by clients. It may be possible to remap it at the kernel level (the mapping from hardware keys to "raw" keys that the X server sees. Citrix is likewise handling key events at a level that xmonad can't intercept, it sounds like. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Brandon,
thanks a lot for the explanation. I have tried to fiddle a little with the
xmodmap and came out with solution that helps (although not solved in
xmonad).
Executing following does precisely what I needed: xmodmap -e "keysym
Super_L = Hyper_L" (while having Hyper_L defined as mod4).
On Mon, Feb 16, 2015 at 4:12 PM, Brandon Allbery
On Mon, Feb 16, 2015 at 9:53 AM, Jiří Maršíček
wrote: Now as I am thinking about it - maybe it might be enough just to change the Super_L modifier to something else that Windows do not recognize. Is it possible to change the keycode of the Win Key to something unused (by using xmodmap) and then define it as meta key in xmonad?
Keycodes are hardcoded in the X server and can't be changed by clients. It may be possible to remap it at the kernel level (the mapping from hardware keys to "raw" keys that the X server sees.
Citrix is likewise handling key events at a level that xmonad can't intercept, it sounds like.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Mon, Feb 16, 2015 at 10:32 AM, Jiří Maršíček
Executing following does precisely what I needed: xmodmap -e "keysym Super_L = Hyper_L" (while having Hyper_L defined as mod4).
Yeh, that'd confirm that Citrix is operating too low level for xmonad to intercept. (If it were at a level xmonad could do something then that wouldn't have any visible effect.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Jiří Maršíček