Skip to content

Uinput keyboard reference

d86leader edited this page Jun 19, 2022 · 3 revisions

With wzmach's UinputAction you send raw keyboard events. Raw keyboard events are not letters, they are key codes, but for convenience they have names. Their names are tied to some legace QWERTY layout similar to what a creator of vim had. It mostly corresponds to a stadard ANSI QWERTY layout, except in code ordering:

Esc    F1 F2 F3 F4    F5 F6 F7 F8    F9 F10 F11 F12                   SysRq  ScrollLock      NumLock    F13 F19 LineFeed
Grave   1 2 3 4 5 6 7 8     9   0 Minus     Equal     BackSpace       Insert Home PageUp                F14 F20 ScrollUp
Tab      Q W E R T Y U I     O   P LeftBrace RightBrace BackSlash     Delete End  PageDown              F15 F21 ScrollDown
CapsLock  A S D F G H J K     L   SemiColon Apostrophe Enter                                            F16 F22
LeftShift  Z X C V B N M Comma Dot Slash              RightShift            Up                          F17 F23
LeftControl LeftMeta LeftAlt Space RightAlt RightMeta RightControl    Left Down Right                   F18 F24

These are the keys I copied from the rust library, admittedly an unmaintained one. There are a couple of questions:

  1. Are PrintScreen and SysRq the same key?
  2. Where is the ContextMenu key? I don't have it on my notebook keyboard, but still
  3. Where are the numpad keys? Are they the same as the regular keys? I recall that mpv at least handles enter key on the main body and on the numpad differently
  4. What are those keys on the right? I assume the F ones are from the new gaming keyboards (they also have the highest codes), and the rightmost three are from some old keyboard variant
  5. What about FN key? Does it even produce a key event that OS observes?

List of all key names supported in config

"Esc"
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"0"
"Minus"
"Equal"
"BackSpace"
"Tab"
"Q"
"W"
"E"
"R"
"T"
"Y"
"U"
"I"
"O"
"P"
"LeftBrace"
"RightBrace"
"Enter"
"LeftControl"
"A"
"S"
"D"
"F"
"G"
"H"
"J"
"K"
"L"
"SemiColon"
"Apostrophe"
"Grave"
"LeftShift"
"BackSlash"
"Z"
"X"
"C"
"V"
"B"
"N"
"M"
"Comma"
"Dot"
"Slash"
"RightShift"
"LeftAlt"
"Space"
"CapsLock"
"F1"
"F2"
"F3"
"F4"
"F5"
"F6"
"F7"
"F8"
"F9"
"F10"
"NumLock"
"ScrollLock"
"F11"
"F12"
"RightControl"
"SysRq"
"RightAlt"
"LineFeed"
"Home"
"Up"
"PageUp"
"Left"
"Right"
"End"
"Down"
"PageDown"
"Insert"
"Delete"
"LeftMeta"
"RightMeta"
"ScrollUp"
"ScrollDown"
"F13"
"F14"
"F15"
"F16"
"F17"
"F18"
"F19"
"F20"
"F21"
"F22"
"F23"
"F24"
Clone this wiki locally