Skip to content

Instantly share code, notes, and snippets.

@seungjin
Last active March 22, 2025 05:15
Show Gist options
  • Save seungjin/48a3f291c9ead64cc6716985d644c699 to your computer and use it in GitHub Desktop.
Save seungjin/48a3f291c9ead64cc6716985d644c699 to your computer and use it in GitHub Desktop.
disable/enable arrow keys
function tog-arr -d "toggle arrow keys"
# Check if keycode 111 is currently mapped to 0xff52
xmodmap -pk | grep '^[[:space:]]*111' | grep 0xff52 >/dev/null 2>&1
if test $status -eq 0
# Unmap arrow keys
xmodmap -e "keycode 111 = " # UP
xmodmap -e "keycode 113 = " # LEFT
xmodmap -e "keycode 114 = " # RIGHT
xmodmap -e "keycode 116 = " # DOWN
else
# Remap arrow keys
xmodmap -e "keycode 111 = 0xff52" # UP
xmodmap -e "keycode 113 = 0xff51" # LEFT
xmodmap -e "keycode 114 = 0xff53" # RIGHT
xmodmap -e "keycode 116 = 0xff54" # DOWN
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment