2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-11 01:10:31 +00:00
cheat.sheets/sheets/xev

16 lines
352 B
Plaintext
Raw Normal View History

# Show keycodes used by Xorg
# start xev and show only the relevant parts:
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
# Alternative approach to show keycodes, with standard AWK formatting.
awk '
/^KeyPress/ {
A[NR+2]
}
NR in A {
B=substr($7, 0, length($7) - 2)
printf("%3d %s\n", $4, B)
}
' <(xev)