How to allow chords of keyboard keys to change the keymap temporarily?
10
votes
3
answers
2155
views
I have really gotten used to the "Simultaneous Vi Mode" functionality of [KeyRemap4MacBook](https://pqrs.org/macosx/keyremap4macbook/) which lets you press and hold the s and d keys simultaneously and then use the h, j, k, and l keys as the arrow keys. When s and d are pressed together, no s or d event is fired, but when I type normally I don't notice any delay problems with hitting s or d individually.
How could I recreate this functionality in Linux (specifically RHEL 6.4)?
A couple ideas I had:
1. If s+d could be remapped to a modifier, then the keys h,j,k,l+modifier could be mapped accordingly. (The keyboard I am using now does not have any spare modifier keys available to use instead of s+d, plus the point of Simultaneous Vi Mode is to keep all fingers on the home row. CapsLock is already remapped to Control and Escape).
2. Ideally, I would find a way to do this using system settings or something like XKB keyboard which I am using already. If that's not possible, perhaps something similar to the [xcape](https://github.com/alols/xcape) program (which I am using and which lets keys be mapped to different keypress and modifier key symbols) could be written. [
xcape
](https://unix.stackexchange.com/questions/tagged/xcape) triggers off of key release though, so it would have to be tweaked to keep the s and d keys from being too slow.
Asked by ws_e_c421
(539 rep)
Dec 31, 2013, 11:37 PM
Last activity: Nov 10, 2017, 05:14 AM
Last activity: Nov 10, 2017, 05:14 AM