5.2. Key Names

You probably ask yourself how to find out key names. Run xev, move your mouse to the newly created window and press a key and see what it says about it. Here is the example after pressing the Right Arrow key:

Example 5-4. xev output for the right arrow key

    KeyPress event, serial 18, synthetic NO, window 0x2c00001,
    root 0x60, subw 0x0, time 3745737930, (373,380), root:(504,526),
    state 0x10, keycode 102 (keysym 0xff53, Right), same_screen YES,
    XLookupString gives 0 characters:  ""

The interesting bit is the key name, which is what's inside the parentheses together with the keysym. In this example, that reads (keysym 0xff53, Right). Thus, the name for the key is Right.

Special Keys

Here are some special keys for your convenience. Note that they will be displayed by xev immediately after you press them (not as modifiers to other keys).

KeyX11 Name
Control, StrgControl
Super, Meta, Win* KeysMod4