You need two command-line based tools, xev and xmodmap.
You can use xev
to remap a key.
Start the terminal window and run xev
, then press the key whose behaviour you want to change. In your case the Tab key.
xev
will show you information about the Tab key. such as:
KeyRelease event, serial 37, synthetic NO, window 0x4000001,
root 0x75, subw 0x0, time 4090453521, (461,542), root:(468,620),
state 0x10, keycode 23 (keysym 0xff09, Tab), same_screen YES,
XLookupString gives 1 bytes: (09) " "
XFilterEvent returns: False
The third line is the most important, where Tab
is the name of the behaviour the key is assigned to at the moment, the number keycode 23
is the internal id to recognize the Tab key.
or the information about the Windows key:
KeyPress event, serial 37, synthetic NO, window 0x4000001,
root 0x75, subw 0x0, time 4090816069, (681,389), root:(688,467),
state 0x10, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Again, the third line is the most important, where Super_L
is the name of the behaviour the key is assigned to at the moment, the number keycode 115
is the internal id to recognize Windwos key.
You can use xmodmap
to swap two keys. Here is a tutorial. For example:
xmodmap -e "keycode 115 = Tab"
This will change the Windows key behaviour and make it behave exactly like a Tab key.
or
xmodmap -e "keycode 115 = Tab j"
This will change the Tab+j key behaviour and make it behave like the Tab key.