-   Linux - Hardware (
-   -   Re-bind broken keyboard key to unused key (

rizzy 03-19-2011 07:18 AM

Re-bind broken keyboard key to unused key
My aging laptop has a key broken - the D key. To replace the keyboard is too expensive, not worth spending 100 on old hardware. I sometimes use an external USB keyboard just to type D but being laptop is not always convenient.
My question is how to bind key letter D to something else, be it a key combo or one of the unused/unneeded keys?
On this italian laptop keyboard there are some keys i never use like Mac style right click menu button next to AltGr or home/end keys i could spare for this.

tredegar 03-19-2011 09:53 AM

If you are running X then xmodmap is the tool you need

rizzy 03-19-2011 10:22 AM

Thank you, just what i was looking for

rizzy 03-19-2011 12:12 PM


xmodmap -e 'keycode 135=d'
the key 135 is the Mac-style menu button.

tredegar 03-19-2011 12:46 PM

That works for you, and gives you a "d" ?
What about a "D" ?

Off-topic: I hate CAPS LOCK so make it act as SHIFT with these commands:
xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "add Shift = Caps_Lock"

rizzy 03-19-2011 01:57 PM

D come up with normal 'shift+new d' press. Stuck the command in a script and openbox start up, works like a charm. Hardest bit is to retrain the mind, still take a bit of time remembering new location.. i like typing fast :)

All times are GMT -5. The time now is 08:25 AM.