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

rizzy 03-19-2011 06: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 08:53 AM

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

rizzy 03-19-2011 09:22 AM

Thank you, just what i was looking for

rizzy 03-19-2011 11:12 AM


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

tredegar 03-19-2011 11:46 AM

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 12: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 06:13 PM.