Thursday, May 4, 2017

XKB Keyboard Mapping - Remapping a Key

I just bought myself a S3 Yoga 14. After installing Ubuntu 16.04, I found out that the key that was suppose to spew out 'pipe' and 'backward slash' (when shifted) actually spewed 'greater than' and 'less than'. This little write up explained how I fixed it.


As a reference, please read this first to get some relevant information:
http://www.antoniusdharijanto.com/2015/10/simple-key-re-mapping-on-ubuntu-1404.html


Steps
1. Figure out the keycode of the offending key
There's a little program 'xev' that when runs from terminal, it would give information about whatever key is pressed, including the keycode.

2. Figure out what the key from (1) is supposed to map into.
Since I have another laptop running Ubuntu, I just run xev there and figure out the keycode of the key 'pipe' and get the action from /usr/share/X11/xkb/keycodes/evdev

2. Re-map that keycode to pip
Open up /usr/share/X11/xkb/keycodes/evdev and remap that keycode to the proper functionality.


Update:
The key to be updated was:
<BKSL> = 94; // Note that other occurence of BKSL has to be commented out for this to work

No comments:

Post a Comment