Page 1 of 1

Easy way to permanently remap two keyboard keys

Posted: Thu May 16, 2019 3:19 pm
by franksr
Hi. I’m new to the forum and new to Linux Mint. I’m hoping someone can help me with a simple solution on how to permanently remap the Right Shift key to the Up Arrow key and the Up Arrow key to the Right Shift key. Lenovo in their infinite wisdom totally messed up the keyboard design by placing the Right Shift key to the right of the Up Arrow key on my Yoga 910 making usage of the Right Shift key counterintuitive. This wasn’t a problem under Windows 10 because I physically swapped the key caps to where they should have been in the first place. I then used a keyboard GUI remapping application to remap the keys. This worked fine until I decided to install Linux Mint. The problem is all my research on how to remap the keys under Linux is way, repeat way, above my head. I can’t find an application with a GUI to allow me to accomplish this. Can someone please provide me with SIMPLE instructions on how to permanently reverse the two keys mappings? Alternatively, is there a way to force Linux to access the Windows mappings which are on the same drive? Thanks in advance for a solution.

Re: Easy way to permanently remap two keyboard keys

Posted: Fri May 17, 2019 1:12 am
by administrollaattori
Keyboard > Layouts > Options
[SOLVED] How to mapping any key to another any key? ->
viewtopic.php?t=282482#p1559702

Re: Easy way to permanently remap two keyboard keys

Posted: Fri May 17, 2019 8:50 am
by magnus7
To swap Up and Right Shift run this command in terminal and restart the computer:

Code: Select all

sudo sed -i \
-e '29s|.*|key<UP>{[Shift_R]};|' \
-e '83s|.*|key<RTSH>{[Up]};|' \
/usr/share/X11/xkb/symbols/pc \
&& sudo dpkg-reconfigure xkb-data

Re: Easy way to permanently remap two keyboard keys

Posted: Fri May 17, 2019 6:32 pm
by franksr
magnus7, Thank you very much for your help! I wasn’t sure of the spacing in the commands but it worked first time. I had spent hours scouring the Internet, to no avail. Thanks again!