Skip to content

Instantly share code, notes, and snippets.

@Flet
Last active January 28, 2024 22:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flet/0c19bac993cea3371a4307fd2cb34374 to your computer and use it in GitHub Desktop.
Save Flet/0c19bac993cea3371a4307fd2cb34374 to your computer and use it in GitHub Desktop.
Vortex Pok3r keyboard arrow key shortcuts as CapsLock + WASD using xmodmap

Overview

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.

Instructions

  1. 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
  1. 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!
  1. 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!

  1. Now test it by rebooting, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment