Xev - Determine custom keybindings

Xev is a command that displays X events (input actions such as mouse or keyboard). This information is commonly used to determine the keybinding name of keyboard custom keys such as the volume or email shortcut buttons.

Install

for installation help, follow this guide.

sudo apt-get install xev
Use to determine keybinding name
1. Launch terminal.
2. Run 'xev' command.
3. Hit the button you want to know the keybinding of.
4. Read the output.
Example output (after hitting volume up key on my keyboard):

CodeKeyPress event, serial 35, synthetic NO, window 0x2400001, root 0x1a7, subw 0x0, time 9065053, (28,3), root:(1067,615), state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x2400001, root 0x1a7, subw 0x0, time 9065190, (28,3), root:(1067,615), state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False Text

Simpler example (F5 key):

KeyPress event, serial 35, synthetic NO, window 0x2400001, root 0x1a7, subw 0x0, time 10722202, (7,3), root:(1046,615), state 0x10, keycode 71 (keysym 0xffc2, F5), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

The keybinding for F5 is F5.