Because my brain can't be untrained, I wanted to emulate the way I have my Vortex Pok3r keyboard arrow key shortcuts in software on my Linux (pop_os) lappy.
- Emulates the my hardware macro setup on my Vortex keyboard but in software.
- Hold
CapsLock
and use WASD as arrow keys - Uses
xmodmap
(I don't think it works on wayland?) - These steps work on pop_os with gnome.
- Create
.Xmodmap
file in home directory with the following contents:
clear Lock
keycode 66 = Mode_switch
keysym w = w W Up Up
keysym a = a A Left Left
keysym s = s S Down Down
keysym d = d D Right Right
- Adjust the mappings if you prefer something else like IJKL
- Try activating manually by running this in a terminal:
xmodmap ~/.Xmodmap
- Now try holding
CapsLock
and pressing WASD keys. They should be arrow keys now!
- To get this to run everytime at startup, create
~/.config/autostart/xmodmapstart.desktop
with the contents:
[Desktop Entry]
Type=Application
Exec=bash -c "sleep 5 && /usr/bin/xmodmap ~/.Xmodmap"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Caps Lock to escape wasd
Name=xcape
Comment[en_US]=
Comment=
NOTE: for whatever reason, the sleep
is necessary for this to work. If you know a better way for this to work in pop_os please comment!
- Now test it by
reboot
ing, logging in, and trying it out.
- This may not work with othre distros/WMs, so you may need to modify the autostart stuff
- (
.Xmodmap
is picked up by some, but others may need to use.xsession
or something else.
- (