I have a laptop where the enter and up arrow keys are physically broken. I have been able to solve this with the following commands:
xmodmap -e "remove shift = Shift_R"
xmodmap -e "keycode 62 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8"
xmodmap -e "remove control = Control_R"
xmodmap -e "keycode 105 = KP_Enter NoSymbol KP_Enter NoSymbol KP_Enter"
That code remaps RCtrl to enter and RShift to up arrow.
This code does work, but it has a minor flaw. When holding either of the keys, there are no repeated key presses. Is there any way to solve this through configuration alone? (Ie, not by modifying source code)
1) What is the best way to apply this configuration? Is there a configuration files for these mappings? (Right now I have a shell script that gets run on each X startup)
2) Any pointers as to how one can remap keys outside of X?