evdev_shortcut/
keycodes.rs

1use num_enum::TryFromPrimitive;
2use parse_display::{Display, FromStr};
3
4/// evdev keycode
5#[derive(Copy, Clone, Debug, TryFromPrimitive, PartialEq, Eq, Hash, Display, FromStr)]
6#[repr(u16)]
7pub enum Key {
8    KeyReserved = 0,
9    KeyEsc = 1,
10    Key1 = 2,
11    Key2 = 3,
12    Key3 = 4,
13    Key4 = 5,
14    Key5 = 6,
15    Key6 = 7,
16    Key7 = 8,
17    Key8 = 9,
18    Key9 = 10,
19    Key0 = 11,
20    KeyMinus = 12,
21    KeyEqual = 13,
22    KeyBackspace = 14,
23    KeyTab = 15,
24    KeyQ = 16,
25    KeyW = 17,
26    KeyE = 18,
27    KeyR = 19,
28    KeyT = 20,
29    KeyY = 21,
30    KeyU = 22,
31    KeyI = 23,
32    KeyO = 24,
33    KeyP = 25,
34    KeyLeftBrace = 26,
35    KeyRightBrace = 27,
36    KeyEnter = 28,
37    KeyLeftCtrl = 29,
38    KeyA = 30,
39    KeyS = 31,
40    KeyD = 32,
41    KeyF = 33,
42    KeyG = 34,
43    KeyH = 35,
44    KeyJ = 36,
45    KeyK = 37,
46    KeyL = 38,
47    KeySemicolon = 39,
48    KeyApostrophe = 40,
49    KeyGrave = 41,
50    KeyLeftShift = 42,
51    KeyBackslash = 43,
52    KeyZ = 44,
53    KeyX = 45,
54    KeyC = 46,
55    KeyV = 47,
56    KeyB = 48,
57    KeyN = 49,
58    KeyM = 50,
59    KeyComma = 51,
60    KeyDot = 52,
61    KeySlash = 53,
62    KeyRightShift = 54,
63    KeyKpAsterisk = 55,
64    KeyLeftAlt = 56,
65    KeySpace = 57,
66    KeyCapsLock = 58,
67    KeyF1 = 59,
68    KeyF2 = 60,
69    KeyF3 = 61,
70    KeyF4 = 62,
71    KeyF5 = 63,
72    KeyF6 = 64,
73    KeyF7 = 65,
74    KeyF8 = 66,
75    KeyF9 = 67,
76    KeyF10 = 68,
77    KeyNumLock = 69,
78    KeyScrollLock = 70,
79    KeyKp7 = 71,
80    KeyKp8 = 72,
81    KeyKp9 = 73,
82    KeyKpMinus = 74,
83    KeyKp4 = 75,
84    KeyKp5 = 76,
85    KeyKp6 = 77,
86    KeyKpPlus = 78,
87    KeyKp1 = 79,
88    KeyKp2 = 80,
89    KeyKp3 = 81,
90    KeyKp0 = 82,
91    KeyKpDot = 83,
92    KeyZenkakuhankaku = 85,
93    Key102nd = 86,
94    KeyF11 = 87,
95    KeyF12 = 88,
96    KeyRo = 89,
97    KeyKatakana = 90,
98    KeyHiragana = 91,
99    KeyHenkan = 92,
100    KeyKatakanahiragana = 93,
101    KeyMuhenkan = 94,
102    KeyKpJpComma = 95,
103    KeyKpEnter = 96,
104    KeyRightCtrl = 97,
105    KeyKpSlash = 98,
106    KeySysRQ = 99,
107    KeyRightAlt = 100,
108    KeyLinefeed = 101,
109    KeyHome = 102,
110    KeyUp = 103,
111    KeyPageup = 104,
112    KeyLeft = 105,
113    KeyRight = 106,
114    KeyEnd = 107,
115    KeyDown = 108,
116    KeyPagedown = 109,
117    KeyInsert = 110,
118    KeyDelete = 111,
119    KeyMacro = 112,
120    KeyMute = 113,
121    KeyVolumeDown = 114,
122    KeyVolumeUp = 115,
123    KeyPower = 116, /* SC System Power Down */
124    KeyKpEqual = 117,
125    KeyKpPlusMinus = 118,
126    KeyPause = 119,
127    KeyScale = 120, /* AL Compiz Scale (Expose) */
128    KeyKpComma = 121,
129    KeyHangeul = 122,
130    KeyHanja = 123,
131    KeyYen = 124,
132    KeyLeftMeta = 125,
133    KeyRightMeta = 126,
134    KeyCompose = 127,
135    KeyStop = 128, /* AC Stop */
136    KeyAgain = 129,
137    KeyProps = 130, /* AC Properties */
138    KeyUndo = 131,  /* AC Undo */
139    KeyFront = 132,
140    KeyCopy = 133,  /* AC Copy */
141    KeyOpen = 134,  /* AC Open */
142    KeyPaste = 135, /* AC Paste */
143    KeyFind = 136,  /* AC Search */
144    KeyCut = 137,   /* AC Cut */
145    KeyHelp = 138,  /* AL Integrated Help Center */
146    KeyMenu = 139,  /* Menu (show menu) */
147    KeyCalc = 140,  /* AL Calculator */
148    KeySetup = 141,
149    KeySleep = 142,  /* SC System Sleep */
150    KeyWakeup = 143, /* System Wake Up */
151    KeyFile = 144,   /* AL Local Machine Browser */
152    KeySendfile = 145,
153    KeyDeleteFile = 146,
154    KeyXfer = 147,
155    KeyProg1 = 148,
156    KeyProg2 = 149,
157    KeyWww = 150, /* AL Internet Browser */
158    KeyMsDos = 151,
159    KeyCoffee = 152, /* AL Terminal Lock/Screensaver */
160    KeyDirection = 153,
161    KeyCycleWindows = 154,
162    KeyMail = 155,
163    KeyBookmarks = 156, /* AC Bookmarks */
164    KeyComputer = 157,
165    KeyBack = 158,    /* AC Back */
166    KeyForward = 159, /* AC Forward */
167    KeyCloseCd = 160,
168    KeyEjectCd = 161,
169    KeyEjectCloseCd = 162,
170    KeyNextSong = 163,
171    KeyPlayPause = 164,
172    KeyPreviousSong = 165,
173    KeyStopCd = 166,
174    KeyRecord = 167,
175    KeyRewind = 168,
176    KeyPhone = 169, /* Media Select Telephone */
177    KeyIso = 170,
178    KeyConfig = 171,   /* AL Consumer Control Configuration */
179    KeyHomepage = 172, /* AC Home */
180    KeyRefresh = 173,  /* AC Refresh */
181    KeyExit = 174,     /* AC Exit */
182    KeyMove = 175,
183    KeyEdit = 176,
184    KeyScrollUp = 177,
185    KeyScrollDown = 178,
186    KeyKpLeftParen = 179,
187    KeyKpRightParen = 180,
188    KeyNew = 181,  /* AC New */
189    KeyRedo = 182, /* AC Redo/Repeat */
190    KeyF13 = 183,
191    KeyF14 = 184,
192    KeyF15 = 185,
193    KeyF16 = 186,
194    KeyF17 = 187,
195    KeyF18 = 188,
196    KeyF19 = 189,
197    KeyF20 = 190,
198    KeyF21 = 191,
199    KeyF22 = 192,
200    KeyF23 = 193,
201    KeyF24 = 194,
202    KeyPlayCd = 200,
203    KeyPauseCd = 201,
204    KeyProg3 = 202,
205    KeyProg4 = 203,
206    KeyDashboard = 204, /* AL Dashboard */
207    KeySuspend = 205,
208    KeyClose = 206, /* AC Close */
209    KeyPlay = 207,
210    KeyFastForward = 208,
211    KeyBassBoost = 209,
212    KeyPrint = 210, /* AC Print */
213    KeyHp = 211,
214    KeyCamera = 212,
215    KeySound = 213,
216    KeyQuestion = 214,
217    KeyEmail = 215,
218    KeyChat = 216,
219    KeySearch = 217,
220    KeyConnect = 218,
221    KeyFinance = 219,
222    KeySport = 220,
223    KeyShop = 221,
224    KeyAltErase = 222,
225    KeyCancel = 223,
226    KeyBrightnessDown = 224,
227    KeyBrightnessUp = 225,
228    KeyMedia = 226,
229    KeySwitchVideoMode = 227,
230    KeyKbDillumToggle = 228,
231    KeyKbDillumDown = 229,
232    KeyKbDillumUp = 230,
233    KeySend = 231,
234    KeyReply = 232,
235    KeyForwardMail = 233,
236    KeySave = 234,
237    KeyDocuments = 235,
238    KeyBattery = 236,
239    KeyBluetooth = 237,
240    KeyWlan = 238,
241    KeyUwb = 239,
242    KeyUnknown = 240,
243    KeyVideoNext = 241,
244    KeyVideoPrev = 242,
245    KeyBrightnessCycle = 243,
246    KeyBrightnessAuto = 244,
247    KeyDisplayOff = 245,
248    KeyWwan = 246,
249    KeyRfKill = 247,
250    KeyMicMute = 248,
251    Btn0 = 0x100,
252    Btn1 = 0x101,
253    Btn2 = 0x102,
254    Btn3 = 0x103,
255    Btn4 = 0x104,
256    Btn5 = 0x105,
257    Btn6 = 0x106,
258    Btn7 = 0x107,
259    Btn8 = 0x108,
260    Btn9 = 0x109,
261    BtnLeft = 0x110,
262    BtnRight = 0x111,
263    BtnMiddle = 0x112,
264    BtnSide = 0x113,
265    BtnExtra = 0x114,
266    BtnForward = 0x115,
267    BtnBack = 0x116,
268    BtnTask = 0x117,
269    BtnTrigger = 0x120,
270    BtnThumb = 0x121,
271    BtnThumb2 = 0x122,
272    BtnTop = 0x123,
273    BtnTop2 = 0x124,
274    BtnPinkie = 0x125,
275    BtnBase = 0x126,
276    BtnBase2 = 0x127,
277    BtnBase3 = 0x128,
278    BtnBase4 = 0x129,
279    BtnBase5 = 0x12a,
280    BtnBase6 = 0x12b,
281    BtnDead = 0x12f,
282    BtnSouth = 0x130,
283    BtnEast = 0x131,
284    BtnC = 0x132,
285    BtnNorth = 0x133,
286    BtnWest = 0x134,
287    BtnZ = 0x135,
288    BtnTl = 0x136,
289    BtnTr = 0x137,
290    BtnTl2 = 0x138,
291    BtnTr2 = 0x139,
292    BtnSelect = 0x13a,
293    BtnStart = 0x13b,
294    BtnMode = 0x13c,
295    BtnThumbL = 0x13d,
296    BtnThumbR = 0x13e,
297    BtnToolPen = 0x140,
298    BtnToolRubber = 0x141,
299    BtnToolBrush = 0x142,
300    BtnToolPencil = 0x143,
301    BtnToolAirbrush = 0x144,
302    BtnToolFinger = 0x145,
303    BtnToolMouse = 0x146,
304    BtnToolLens = 0x147,
305    BtnToolQuintTap = 0x148, /* Five fingers on trackpad */
306    BtnTouch = 0x14a,
307    BtnStylus = 0x14b,
308    BtnStylus2 = 0x14c,
309    BtnToolDoubleTap = 0x14d,
310    BtnToolTripleTap = 0x14e,
311    BtnToolQuadTap = 0x14f, /* Four fingers on trackpad */
312    BtnGearDown = 0x150,
313    BtnGearUp = 0x151,
314    KeyOk = 0x160,
315    KeySelect = 0x161,
316    KeyGoto = 0x162,
317    KeyClear = 0x163,
318    KeyPower2 = 0x164,
319    KeyOption = 0x165,
320    KeyInfo = 0x166, /* AL OEM Features/Tips/Tutorial */
321    KeyTime = 0x167,
322    KeyVendor = 0x168,
323    KeyArchive = 0x169,
324    KeyProgram = 0x16a, /* Media Select Program Guide */
325    KeyChannel = 0x16b,
326    KeyFavorites = 0x16c,
327    KeyEpg = 0x16d,
328    KeyPvr = 0x16e, /* Media Select Home */
329    KeyMhp = 0x16f,
330    KeyLanguage = 0x170,
331    KeyTitle = 0x171,
332    KeySubtitle = 0x172,
333    KeyAngle = 0x173,
334    KeyZoom = 0x174,
335    KeyMode = 0x175,
336    KeyKeyboard = 0x176,
337    KeyScreen = 0x177,
338    KeyPc = 0x178,   /* Media Select Computer */
339    KeyTv = 0x179,   /* Media Select TV */
340    KeyTv2 = 0x17a,  /* Media Select Cable */
341    KeyVcr = 0x17b,  /* Media Select VCR */
342    KeyVcr2 = 0x17c, /* VCR Plus */
343    KeySat = 0x17d,  /* Media Select Satellite */
344    KeySat2 = 0x17e,
345    KeyCd = 0x17f,   /* Media Select CD */
346    KeyTape = 0x180, /* Media Select Tape */
347    KeyRadio = 0x181,
348    KeyTuner = 0x182, /* Media Select Tuner */
349    KeyPlayer = 0x183,
350    KeyText = 0x184,
351    KeyDvd = 0x185, /* Media Select DVD */
352    KeyAux = 0x186,
353    KeyMp3 = 0x187,
354    KeyAudio = 0x188, /* AL Audio Browser */
355    KeyVideo = 0x189, /* AL Movie Browser */
356    KeyDirectory = 0x18a,
357    KeyList = 0x18b,
358    KeyMemo = 0x18c, /* Media Select Messages */
359    KeyCalendar = 0x18d,
360    KeyRed = 0x18e,
361    KeyGreen = 0x18f,
362    KeyYellow = 0x190,
363    KeyBlue = 0x191,
364    KeyChannelUp = 0x192,   /* Channel Increment */
365    KeyChannelDown = 0x193, /* Channel Decrement */
366    KeyFirst = 0x194,
367    KeyLast = 0x195, /* Recall Last */
368    KeyAb = 0x196,
369    KeyNext = 0x197,
370    KeyRestart = 0x198,
371    KeySlow = 0x199,
372    KeyShuffle = 0x19a,
373    KeyBreak = 0x19b,
374    KeyPrevious = 0x19c,
375    KeyDigits = 0x19d,
376    KeyTeen = 0x19e,
377    KeyTwen = 0x19f,
378    KeyVideophone = 0x1a0,     /* Media Select Video Phone */
379    KeyGames = 0x1a1,          /* Media Select Games */
380    KeyZoomIn = 0x1a2,         /* AC Zoom In */
381    KeyZoomOut = 0x1a3,        /* AC Zoom Out */
382    KeyZoomReset = 0x1a4,      /* AC Zoom */
383    KeyWordProcessor = 0x1a5,  /* AL Word Processor */
384    KeyEditor = 0x1a6,         /* AL Text Editor */
385    KeySpreadsheet = 0x1a7,    /* AL Spreadsheet */
386    KeyGraphicsEditor = 0x1a8, /* AL Graphics Editor */
387    KeyPresentation = 0x1a9,   /* AL Presentation App */
388    KeyDatabase = 0x1aa,       /* AL Database App */
389    KeyNews = 0x1ab,           /* AL Newsreader */
390    KeyVoiceMail = 0x1ac,      /* AL Voicemail */
391    KeyAddressBook = 0x1ad,    /* AL Contacts/Address Book */
392    KeyMessenger = 0x1ae,      /* AL Instant Messaging */
393    KeyDisplayToggle = 0x1af,  /* Turn display (LCD) on and off */
394    KeySpellcheck = 0x1b0,     /* AL Spell Check */
395    KeyLogoff = 0x1b1,         /* AL Logoff */
396    KeyDollar = 0x1b2,
397    KeyEuro = 0x1b3,
398    KeyFrameBack = 0x1b4, /* Consumer - transport controls */
399    KeyFrameForward = 0x1b5,
400    KeyContextMenu = 0x1b6,    /* GenDesc - system context menu */
401    KeyMediaRepeat = 0x1b7,    /* Consumer - transport control */
402    Key10ChannelsUp = 0x1b8,   /* 10 channels up (10+) */
403    Key10ChannelsDown = 0x1b9, /* 10 channels down (10-) */
404    KeyImages = 0x1ba,         /* AL Image Browser */
405    KeyDelEol = 0x1c0,
406    KeyDelEos = 0x1c1,
407    KeyInsLine = 0x1c2,
408    KeyDelLine = 0x1c3,
409    KeyFn = 0x1d0,
410    KeyFnEsc = 0x1d1,
411    KeyFnF1 = 0x1d2,
412    KeyFnF2 = 0x1d3,
413    KeyFnF3 = 0x1d4,
414    KeyFnF4 = 0x1d5,
415    KeyFnF5 = 0x1d6,
416    KeyFnF6 = 0x1d7,
417    KeyFnF7 = 0x1d8,
418    KeyFnF8 = 0x1d9,
419    KeyFnF9 = 0x1da,
420    KeyFnF10 = 0x1db,
421    KeyFnF11 = 0x1dc,
422    KeyFnF12 = 0x1dd,
423    KeyFn1 = 0x1de,
424    KeyFn2 = 0x1df,
425    KeyFnD = 0x1e0,
426    KeyFnE = 0x1e1,
427    KeyFnF = 0x1e2,
428    KeyFnS = 0x1e3,
429    KeyFnB = 0x1e4,
430    KeyBrlDot1 = 0x1f1,
431    KeyBrlDot2 = 0x1f2,
432    KeyBrlDot3 = 0x1f3,
433    KeyBrlDot4 = 0x1f4,
434    KeyBrlDot5 = 0x1f5,
435    KeyBrlDot6 = 0x1f6,
436    KeyBrlDot7 = 0x1f7,
437    KeyBrlDot8 = 0x1f8,
438    KeyBrlDot9 = 0x1f9,
439    KeyBrlDot10 = 0x1fa,
440    KeyNumeric0 = 0x200, /* used by phones, remote controls, */
441    KeyNumeric1 = 0x201, /* and other keypads */
442    KeyNumeric2 = 0x202,
443    KeyNumeric3 = 0x203,
444    KeyNumeric4 = 0x204,
445    KeyNumeric5 = 0x205,
446    KeyNumeric6 = 0x206,
447    KeyNumeric7 = 0x207,
448    KeyNumeric8 = 0x208,
449    KeyNumeric9 = 0x209,
450    KeyNumericStar = 0x20a,
451    KeyNumericPound = 0x20b,
452    KeyCameraFocus = 0x210,
453    KeyWpsButton = 0x211,      /* WiFi Protected Setup key */
454    KeyTouchpadToggle = 0x212, /* Request switch touchpad on or off */
455    KeyTouchpadOn = 0x213,
456    KeyTouchpadOff = 0x214,
457    KeyCameraZoomIn = 0x215,
458    KeyCameraZoomOut = 0x216,
459    KeyCameraUp = 0x217,
460    KeyCameraDown = 0x218,
461    KeyCameraLeft = 0x219,
462    KeyCameraRight = 0x21a,
463    KeyAttendantOn = 0x21b,
464    KeyAttendantOff = 0x21c,
465    KeyAttendantToggle = 0x21d, /* Attendant call on or off */
466    KeyLightsToggle = 0x21e,    /* Reading light on or off */
467    BtnDpadUp = 0x220,
468    BtnDpadDown = 0x221,
469    BtnDpadLeft = 0x222,
470    BtnDpadRight = 0x223,
471    KeyAlsToggle = 0x230,     /* Ambient light sensor */
472    KeyButtonConfig = 0x240,  /* AL Button Configuration */
473    KeyTaskManager = 0x241,   /* AL Task/Project Manager */
474    KeyJournal = 0x242,       /* AL Log/Journal/Timecard */
475    KeyControlPanel = 0x243,  /* AL Control Panel */
476    KeyAppSelect = 0x244,     /* AL Select Task/Application */
477    KeyScreenSaver = 0x245,   /* AL Screen Saver */
478    KeyVoiceCommand = 0x246,  /* Listening Voice Command */
479    KeyBrightnessMin = 0x250, /* Set Brightness to Minimum */
480    KeyBrightnessMax = 0x251, /* Set Brightness to Maximum */
481    KeyKbdinputassistPrev = 0x260,
482    KeyKbdinputassistNext = 0x261,
483    KeyKbdinputassistPrevgroup = 0x262,
484    KeyKbdinputassistNextgroup = 0x263,
485    KeyKbdinputassistAccept = 0x264,
486    KeyKbdinputassistCancel = 0x265,
487    BtnTriggerHappy1 = 0x2c0,
488    BtnTriggerHappy2 = 0x2c1,
489    BtnTriggerHappy3 = 0x2c2,
490    BtnTriggerHappy4 = 0x2c3,
491    BtnTriggerHappy5 = 0x2c4,
492    BtnTriggerHappy6 = 0x2c5,
493    BtnTriggerHappy7 = 0x2c6,
494    BtnTriggerHappy8 = 0x2c7,
495    BtnTriggerHappy9 = 0x2c8,
496    BtnTriggerHappy10 = 0x2c9,
497    BtnTriggerHappy11 = 0x2ca,
498    BtnTriggerHappy12 = 0x2cb,
499    BtnTriggerHappy13 = 0x2cc,
500    BtnTriggerHappy14 = 0x2cd,
501    BtnTriggerHappy15 = 0x2ce,
502    BtnTriggerHappy16 = 0x2cf,
503    BtnTriggerHappy17 = 0x2d0,
504    BtnTriggerHappy18 = 0x2d1,
505    BtnTriggerHappy19 = 0x2d2,
506    BtnTriggerHappy20 = 0x2d3,
507    BtnTriggerHappy21 = 0x2d4,
508    BtnTriggerHappy22 = 0x2d5,
509    BtnTriggerHappy23 = 0x2d6,
510    BtnTriggerHappy24 = 0x2d7,
511    BtnTriggerHappy25 = 0x2d8,
512    BtnTriggerHappy26 = 0x2d9,
513    BtnTriggerHappy27 = 0x2da,
514    BtnTriggerHappy28 = 0x2db,
515    BtnTriggerHappy29 = 0x2dc,
516    BtnTriggerHappy30 = 0x2dd,
517    BtnTriggerHappy31 = 0x2de,
518    BtnTriggerHappy32 = 0x2df,
519    BtnTriggerHappy33 = 0x2e0,
520    BtnTriggerHappy34 = 0x2e1,
521    BtnTriggerHappy35 = 0x2e2,
522    BtnTriggerHappy36 = 0x2e3,
523    BtnTriggerHappy37 = 0x2e4,
524    BtnTriggerHappy38 = 0x2e5,
525    BtnTriggerHappy39 = 0x2e6,
526    BtnTriggerHappy40 = 0x2e7,
527    KeyMax = 0x2ff,
528}