Skip to content

Instantly share code, notes, and snippets.

@rjchow
Created July 12, 2021 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjchow/d593d0effc18ba89cbd947d370f0d334 to your computer and use it in GitHub Desktop.
Save rjchow/d593d0effc18ba89cbd947d370f0d334 to your computer and use it in GitHub Desktop.
Capslock to Escape+Ctrl Remap
# ~/.dual-function-keys.yaml
TIMING:
TAP_MILLISEC: 200
DOUBLE_TAP_MILLISEC: 150
MAPPINGS:
- KEY: KEY_CAPSLOCK
TAP: KEY_ESC
HOLD: KEY_LEFTCTRL
- KEY: KEY_ESC
TAP: KEY_CAPSLOCK
HOLD: KEY_CAPSLOCK
# /etc/systemd/system/udevmon.service
[Unit]
Description=udevmon
Wants=systemd-udev-settle.service
After=systemd-udev-settle.service
[Service]
ExecStart=/usr/bin/nice -n -20 /usr/bin/udevmon -c /etc/udevmon.yaml
[Install]
WantedBy=multi-user.target
# /etc/udevmon.yaml
- JOB: "intercept -g $DEVNODE | dual-function-keys -c ~/.dual-function-keys.yaml | uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_ESC, KEY_CAPSLOCK]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment