1.5 KiB
created | layout | layout_old | redirect_to | tags | title | toc | updated | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2017-01-20 11:14:41 +0100 | redirect | default | https://blog.mbirth.de/archives/2017/01/20/system-wide-key-remapping-in-ubuntu.html |
|
System wide key remapping in Ubuntu | false | 2017-01-20 11:14:41 +0100 |
On my [hp Spectre x360]({% post_url 2016-07-26-hp-spectre-x360 %}), the Ins key is only reachable via the Fn key as in Fn+PrtScr.
So I wanted to swap both keys. System-wide - so not only in X (using xev
).
I finally found this which suggested the following procedure:
-
Dump the current keyboard layout:
sudo dumpkeys > backup.kmap
-
Check the keycodes you want to change (Ins = 110, PrtScr = 99):
sudo showkey
(When you're done, wait 10 seconds for it to exit automatically.)
-
Copy the dumped keyboard layout:
cp backup.kmap ins-prt-swap.kmap
-
Edit it to swap all occurrences of
99
to110
and vice versa, e.g. change:keycode 99 = ... ... keycode 110 = Insert.....
to
keycode 110 = ... ... keycode 99 = Insert.....
-
The suggested
sudo setcon --save
didn't work for me, but Ubuntu loads the active keymap from the file/etc/console-setup/cached.kmap.gz
. So I gzipped myins-prt-swap.kmap
and copied the resultingins-prt-swap.kmap.gz
to/etc/console-setup/cached.kmap.gz
.