They used to be in /usr/lib/X11/XKeysymDB or /usr/share/X11/XKeysymDB, but those have been missing from Ubuntu for a while. I've tried google, but all I get are more references to XKeysymDB or the outputs of different people's xmodmap -pke
. Where is the concise list?

- 545
2 Answers
Probably the best up-to-date values for key symbol definitions is to look at the source-code.
Basically its just a list of keysym names with their associated codes.
sudo apt-get install x11proto-core-dev
Two key keyfiles in /usr/include/X11
:
The main definition file:
/usr/include/X11/keysymdef.h
Vendor specific (i.e. Debian/Ubuntu):
/usr/include/X11/XF86keysym.h
There are a number of other header files in the same folder you can also examine:
$ grep -l '#define.*XK_' /usr/include/X11/*.h
Example definition from /usr/include/X11/keysymdef.h
:
#define XK_BackSpace 0xff08 /* Back space, back char */
#define XK_Tab 0xff09
#define XK_Linefeed 0xff0a /* Linefeed, LF */
#define XK_Clear 0xff0b
#define XK_Return 0xff0d /* Return, enter */
#define XK_Pause 0xff13 /* Pause, hold */
#define XK_Scroll_Lock 0xff14
#define XK_Sys_Req 0xff15
#define XK_Escape 0xff1b
#define XK_Delete 0xffff /* Delete, rubout */

- 13,065
- 5
- 49
- 65

- 172,746
-
1Cheers, but I can't see XF86Bluetooth or XF86WLAN etc, so is there another header too? – Dave E Jan 08 '12 at 11:46
-
2... updated - bluetooth/wlan is in XF86... – fossfreedom Jan 08 '12 at 12:04
-
Bingo! Thanks. Oops though, I didn't mean to vote that as a 'great comment'. – Dave E Jan 08 '12 at 12:20
-
3For occasional Googlers: equivalent package for Fedora/Red Hat is called xorg-x11-proto-devel – Alois Mahdal May 12 '14 at 12:15
-
Update: these days, the interesting files in Fedora now live in libxkbcommon-devel – BRPocock Oct 27 '16 at 17:05
-
The package is x11proto-dev in Ubuntu 18.04 and later. – jarno Jan 30 '20 at 13:00
Note that if you want to learn the code for a specific key on your keyboard, you can use xev
for X11 or wev
for Wayland.
After starting xev
/wev
, you can press the key and see the X events printed to the terminal.
You can use xev | grep keysym
/wev | grep keysym
to filter the lines for the essential information. The keysym you need will be the second second argument in parenthesis.

- 624
-
1Not that
xev
is for X11. The corresponding software for Wayland iswev
. – robertspierre May 26 '23 at 04:40 -
@robertspierre Thanks for the comment and for the edit! (Approved.) – VasyaNovikov May 26 '23 at 08:42