I would like to be able to apply the same custom key bindings and shortcuts I use on my text editors to my entire desktop environment.
I want to basically remap my keyboard system-wide, not just in a specific application window. That is, when I remap
alt + j = Down, I want pressing
alt + j to be the same as pressing the "down" key, as far as my desktop environment is concerned.
The shortcuts I use are optimised for keeping hands in a natural position close to the home row at all times:
# Note how # system-wide remapping of *single* keys is possible with xmodmap. Caps Lock --> Escape Escape --> Caps Lock # Switch caps lock with # the more useful escape key. # As far as *all* applications # are concerned, pressing caps lock # is actually pressing Escape. # However, I've not found a good way do the same for multiple keys: alt + space --> Right Arrow alt + Escape --> Enter shift + alt + h --> Backspace alt + x --> Delete shift + alt + l --> Delete ctrl + alt --> Alt # Default alt functionalities # remapped to ctrl + alt
In my text editor, this has done wonders for my accuracy, speed, and has helped me tremendously with tendon pains I was having, since my hands now barely need to leave their natural resting position.
First almost-successful attempt at a solution:
Using xbindkeys to call up xvkbd (x virtual keyboard). This is a sample from my
# h-j-k-l Movement ################### "xvkbd -xsendevent -text "\[Down]"" alt + j "xvkbd -xsendevent -text "\[Up]"" alt + k "xvkbd -xsendevent -text "\[Left]"" alt + h "xvkbd -xsendevent -text "\[Right]"" alt + l
alt key is usually the default key for calling the menu of an application (for example,
alt + F brings up the *F*ile dropdown menu in most applications).
Also, this seems to work with some applications, while others seem to ignore it.
xbindkeys isn't really remapping the keyboard, it's just telling xvkbd to send a signal, which can sometimes create conflicts with the active application (unlike xmodmap, which truly remaps the keyboard).
A system-wide remapping of my keyboard, implemented in a way that is easily portable (an rc file or something similar).
alt is the optimal key of choice, since
ctrl is heavily used across applications, and the mod key is taken up by my windows manager (Xmonad).
I'm running Ubuntu 12.10, with the Xmonad desktop environment.
Is this doable? I don't yet know much about OS-level stuff and how it processes input.