Skip to content

Instantly share code, notes, and snippets.

@danielrosehill
Created November 27, 2025 13:21
Show Gist options
  • Select an option

  • Save danielrosehill/82265a0578b1e0120750aaf077668bf8 to your computer and use it in GitHub Desktop.

Select an option

Save danielrosehill/82265a0578b1e0120750aaf077668bf8 to your computer and use it in GitHub Desktop.
Extended F-Keys (F13-F35) - Linux Kernel, XKB, and Qt Support Reference

Extended Function Keys (F13-F35) on Linux

A reference guide for mapping keys beyond F12 on Linux systems.

Summary

Layer F-Key Range Notes
Linux Kernel F1-F24 Native evdev keycodes
XKB (X11/Wayland) F1-F24 Mapped via evdev keycodes
Qt/KDE F1-F35 Full support in Qt framework

Linux Kernel Support (evdev)

The Linux kernel defines keycodes for F1-F24 in /usr/include/linux/input-event-codes.h:

Key Keycode Notes
F1-F10 59-68 Standard range
F11 87
F12 88
F13 183 Extended keys start here
F14 184
F15 185
F16 186
F17 187
F18 188
F19 189
F20 190
F21 191
F22 192
F23 193
F24 194 Highest kernel-supported F-key

XKB (X11/Wayland) Support

XKB maps these kernel keycodes to symbolic names. The evdev keycode file (/usr/share/X11/xkb/keycodes/evdev) provides aliases:

<FK13> = 191   (alias <I191> = <FK13>)  // kernel KEY_F13 = 183
<FK14> = 192   (alias <I192> = <FK14>)  // kernel KEY_F14 = 184
...
<FK24> = 202   (alias <I202> = <FK24>)  // kernel KEY_F24 = 194

Note: There's an offset between kernel keycodes and XKB keycodes (XKB adds 8 to kernel codes).

Qt/KDE Support

Qt defines F-keys up to F35 (Qt::Key_F1 through Qt::Key_F35):

  • F1-F24: Fully supported with kernel backing
  • F25-F35: Defined in Qt but have no kernel keycode backing

This means KDE Plasma (which uses Qt) can theoretically handle F25-F35 shortcuts, but you cannot generate these keys from hardware or input-remapper since the kernel doesn't define them.

Practical Recommendations

Best Keys for Custom Bindings

F13-F24 are ideal for custom shortcuts because:

  • They're rarely on physical keyboards
  • Full kernel + XKB + Qt support
  • Can be generated via tools like input-remapper

Tools for Remapping

  • input-remapper: Map any key/button to F13-F24
  • xdotool (X11): xdotool key F13
  • ydotool (Wayland): ydotool key 183:1 183:0
  • wtype (Wayland): Can send F13-F24

Potential Issues

  1. KDE Shortcut Dialog: May not accept F13+ in the GUI shortcut picker even though the keys work
  2. Application Support: Some applications may not recognize F13-F24
  3. Wayland Compositors: Support varies; KWin (KDE) should work

Testing Key Detection

# Check if a key is being sent (requires sudo)
sudo evtest

# Or use wev on Wayland
wev

Generated by Claude Code. Please verify this information against your specific system configuration.

Comments are disabled for this gist.