Last active
March 22, 2025 05:15
-
-
Save seungjin/48a3f291c9ead64cc6716985d644c699 to your computer and use it in GitHub Desktop.
disable/enable arrow keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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