how to remap Ctrl to Escape if pressed and released on its own

Posted by psvm on Ask Ubuntu See other posts from Ask Ubuntu or by psvm
Published on 2012-11-22T22:30:07Z Indexed on 2012/11/22 23:10 UTC
Read the original article Hit count: 243

Filed under:
|
|
|

I want to remap Control, so that: A. If it is pressed and released with no other key, it acts as Escape. B. If it is pressed & held together with another key, it acts as Control (no change in behavior in this case).

I'm aware of How do I remap certain keys?, so I suspect it may be done with xmodmap. But that answer does not explain how to map the modifier keys. I looked into the examples and grammar sections of the xmodmap manpage, but they do not explain that. The answer in Remapping Caps Lock to Control and Escape (not the usual way) mention that it is not possible to do that to CapsLock, since it is a Lock key, but I hope this may be possible to do it with Control which is a mod key. A solution with something different than xmodmap will also be accepted. (I'm running Xmonad in Ubuntu 12.04, so perhaps there is a way to set this up in xmonad.hs?)

© Ask Ubuntu or respective owner

Related posts about keyboard

Related posts about xmodmap