Skip to content

Instantly share code, notes, and snippets.

@matthewblott
Created December 6, 2021 20:35
Show Gist options
  • Save matthewblott/f1ec0a970a94dcdbfc9199149cb28ce8 to your computer and use it in GitHub Desktop.
Save matthewblott/f1ec0a970a94dcdbfc9199149cb28ce8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# To find a key code execute the command below and then hover the mouse over the
# square in the window that appears. Press the key you wish to find the key code for
# and then set the focus back to the terminal and the key with its code will appear.
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