Skip to content

Instantly share code, notes, and snippets.

@teddyhartanto
Last active December 25, 2017 09:18
Show Gist options
  • Select an option

  • Save teddyhartanto/ae64a3c08d0a9706c3950f0c94b0475e to your computer and use it in GitHub Desktop.

Select an option

Save teddyhartanto/ae64a3c08d0a9706c3950f0c94b0475e to your computer and use it in GitHub Desktop.
Modifying key mapping in Linux distros
Source: http://askubuntu.com/questions/296155/how-can-i-remap-keyboard-keys
xev
[Press the button you want to change]
[Press the button you want to map to]
quit the program
xmodmap -e "keycode [key_to_change] = [what_you_want] [what_you_want_on_shift]"
xmodmap -pke | grep [keycode]
See the changes take place. Enjoy!
More concretely (because my 4/$ is broken):
xev
[Press useless button], keycode = 94
xmodmap -pke | grep 4 -> search for keycode that maps to 4 and dollar # this is totally optional!
Do: `xmodmap -e "keycode 94 = 4 dollar"`
Apparently in VMs, the keycode for my useless button is always 94
So I can always issue this command: `xmodmap -e "keycode 94 = 4 dollar"`
Happy :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment