Skip to content

Instantly share code, notes, and snippets.

@MikaelElkiaer
Created January 2, 2020 20:38
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 MikaelElkiaer/93a8f8dc7fd9bfc6896aaaaddeb6e441 to your computer and use it in GitHub Desktop.
Save MikaelElkiaer/93a8f8dc7fd9bfc6896aaaaddeb6e441 to your computer and use it in GitHub Desktop.
Get keycode based on keypress
#/bin/sh
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment