Discussion:
[xmonad] Configure eating of keys based on window class
Jiří Maršíček
2015-02-16 13:27:38 UTC
Permalink
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.
Brandon Allbery
2015-02-16 14:41:20 UTC
Permalink
Post by Jiří Maršíček
I have tried to define this globaly by adding the following line to my
((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
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Jiří Maršíček
2015-02-16 14:53:54 UTC
Permalink
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?
Post by Brandon Allbery
Post by Jiří Maršíček
I have tried to define this globaly by adding the following line to my
((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
unix, openafs, kerberos, infrastructure, xmonad
http://sinenomine.net
Brandon Allbery
2015-02-16 15:12:08 UTC
Permalink
Post by 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
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Jiří Maršíček
2015-02-16 15:32:09 UTC
Permalink
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).
Post by Brandon Allbery
Post by 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
unix, openafs, kerberos, infrastructure, xmonad
http://sinenomine.net
Brandon Allbery
2015-02-16 16:22:30 UTC
Permalink
Post by 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
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Loading...