1#![doc=include_str!("../README.md")]
2#![cfg_attr(doc_cfg, feature(doc_cfg))]
3
4#[cfg(any(feature = "enum", doc))]
5use strum_macros::{FromRepr, EnumCount};
6
7pub mod writing_system {
10 pub const BACKQUOTE: &'static str = "Backquote";
11 pub const BACKSLASH: &'static str = "Backslash";
12 pub const BACKSPACE: &'static str = "Backspace";
13 pub const BRACKET_LEFT: &'static str = "BracketLeft";
14 pub const BRACKET_RIGHT: &'static str = "BracketRight";
15 pub const COMMA: &'static str = "Comma";
16 pub const DIGIT0: &'static str = "Digit0";
17 pub const DIGIT1: &'static str = "Digit1";
18 pub const DIGIT2: &'static str = "Digit2";
19 pub const DIGIT3: &'static str = "Digit3";
20 pub const DIGIT4: &'static str = "Digit4";
21 pub const DIGIT5: &'static str = "Digit5";
22 pub const DIGIT6: &'static str = "Digit6";
23 pub const DIGIT7: &'static str = "Digit7";
24 pub const DIGIT8: &'static str = "Digit8";
25 pub const DIGIT9: &'static str = "Digit9";
26 pub const EQUAL: &'static str = "Equal";
27 pub const INTL_BACKSLASH: &'static str = "IntlBackslash";
28 pub const INTL_RO: &'static str = "IntlRo";
29 pub const INTL_YEN: &'static str = "IntlYen";
30 pub const KEY_A: &'static str = "KeyA";
31 pub const KEY_B: &'static str = "KeyB";
32 pub const KEY_C: &'static str = "KeyC";
33 pub const KEY_D: &'static str = "KeyD";
34 pub const KEY_E: &'static str = "KeyE";
35 pub const KEY_F: &'static str = "KeyF";
36 pub const KEY_G: &'static str = "KeyG";
37 pub const KEY_H: &'static str = "KeyH";
38 pub const KEY_I: &'static str = "KeyI";
39 pub const KEY_J: &'static str = "KeyJ";
40 pub const KEY_K: &'static str = "KeyK";
41 pub const KEY_L: &'static str = "KeyL";
42 pub const KEY_M: &'static str = "KeyM";
43 pub const KEY_N: &'static str = "KeyN";
44 pub const KEY_O: &'static str = "KeyO";
45 pub const KEY_P: &'static str = "KeyP";
46 pub const KEY_Q: &'static str = "KeyQ";
47 pub const KEY_R: &'static str = "KeyR";
48 pub const KEY_S: &'static str = "KeyS";
49 pub const KEY_T: &'static str = "KeyT";
50 pub const KEY_U: &'static str = "KeyU";
51 pub const KEY_V: &'static str = "KeyV";
52 pub const KEY_W: &'static str = "KeyW";
53 pub const KEY_X: &'static str = "KeyX";
54 pub const KEY_Y: &'static str = "KeyY";
55 pub const KEY_Z: &'static str = "KeyZ";
56 pub const MINUS: &'static str = "Minus";
57 pub const PERIOD: &'static str = "Period";
58 pub const QUOTE: &'static str = "Quote";
59 pub const SEMICOLON: &'static str = "Semicolon";
60 pub const SLASH: &'static str = "Slash";
61}
62pub use writing_system::*;
63
64pub mod functional {
67 pub mod alphanumeric {
68 pub const ALT_LEFT: &'static str = "AltLeft";
69 pub const ALT_RIGHT: &'static str = "AltRight";
70 pub const CAPS_LOCK: &'static str = "CapsLock";
71 pub const CONTEXT_MENU: &'static str = "ContextMenu";
72 pub const CONTROL_LEFT: &'static str = "ControlLeft";
73 pub const CONTROL_RIGHT: &'static str = "ControlRight";
74 pub const ENTER: &'static str = "Enter";
75 pub const META_LEFT: &'static str = "MetaLeft";
76 pub const META_RIGHT: &'static str = "MetaRight";
77 pub const SHIFT_LEFT: &'static str = "ShiftLeft";
78 pub const SHIFT_RIGHT: &'static str = "ShiftRight";
79 pub const SPACE: &'static str = "Space";
80 pub const TAB: &'static str = "Tab";
81 }
82 pub use alphanumeric::*;
83
84 pub mod japanese_and_korean {
85 pub const CONVERT: &'static str = "Convert";
86 pub const KANA_MODE: &'static str = "KanaMode";
87 pub const LANG1: &'static str = "Lang1";
88 pub const LANG2: &'static str = "Lang2";
89 pub const LANG3: &'static str = "Lang3";
90 pub const LANG4: &'static str = "Lang4";
91 pub const LANG5: &'static str = "Lang5";
92 pub const NON_CONVERT: &'static str = "NonConvert";
93 }
94 pub use japanese_and_korean::*;
95}
96pub use functional::*;
97
98pub mod control_pad {
101 pub const DELETE: &'static str = "Delete";
102 pub const END: &'static str = "End";
103 pub const HELP: &'static str = "Help";
104 pub const HOME: &'static str = "Home";
105 pub const INSERT: &'static str = "Insert";
106 pub const PAGE_DOWN: &'static str = "PageDown";
107 pub const PAGE_UP: &'static str = "PageUp";
108}
109pub use self::control_pad::*;
110
111pub mod arrow_pad {
114 pub const ARROW_DOWN: &'static str = "ArrowDown";
115 pub const ARROW_LEFT: &'static str = "ArrowLeft";
116 pub const ARROW_RIGHT: &'static str = "ArrowRight";
117 pub const ARROW_UP: &'static str = "ArrowUp";
118}
119pub use self::arrow_pad::*;
120
121pub mod numpad {
124 pub const NUM_LOCK: &'static str = "NumLock";
125 pub const NUMPAD0: &'static str = "Numpad0";
126 pub const NUMPAD1: &'static str = "Numpad1";
127 pub const NUMPAD2: &'static str = "Numpad2";
128 pub const NUMPAD3: &'static str = "Numpad3";
129 pub const NUMPAD4: &'static str = "Numpad4";
130 pub const NUMPAD5: &'static str = "Numpad5";
131 pub const NUMPAD6: &'static str = "Numpad6";
132 pub const NUMPAD7: &'static str = "Numpad7";
133 pub const NUMPAD8: &'static str = "Numpad8";
134 pub const NUMPAD9: &'static str = "Numpad9";
135 pub const NUMPAD_ADD: &'static str = "NumpadAdd";
136 pub const NUMPAD_BACKSPACE: &'static str = "NumpadBackspace";
137 pub const NUMPAD_CLEAR: &'static str = "NumpadClear";
138 pub const NUMPAD_CLEAR_ENTRY: &'static str = "NumpadClearEntry";
139 pub const NUMPAD_COMMA: &'static str = "NumpadComma";
140 pub const NUMPAD_DECIMAL: &'static str = "NumpadDecimal";
141 pub const NUMPAD_DIVIDE: &'static str = "NumpadDivide";
142 pub const NUMPAD_ENTER: &'static str = "NumpadEnter";
143 pub const NUMPAD_EQUAL: &'static str = "NumpadEqual";
144 pub const NUMPAD_HASH: &'static str = "NumpadHash";
145 pub const NUMPAD_MEMORY_ADD: &'static str = "NumpadMemoryAdd";
146 pub const NUMPAD_MEMORY_CLEAR: &'static str = "NumpadMemoryClear";
147 pub const NUMPAD_MEMORY_RECALL: &'static str = "NumpadMemoryRecall";
148 pub const NUMPAD_MEMORY_STORE: &'static str = "NumpadMemoryStore";
149 pub const NUMPAD_MEMORY_SUBTRACT: &'static str = "NumpadMemorySubtract";
150 pub const NUMPAD_MULTIPLY: &'static str = "NumpadMultiply";
151 pub const NUMPAD_PAREN_LEFT: &'static str = "NumpadParenLeft";
152 pub const NUMPAD_PAREN_RIGHT: &'static str = "NumpadParenRight";
153 pub const NUMPAD_STAR: &'static str = "NumpadStar";
154 pub const NUMPAD_SUBTRACT: &'static str = "NumpadSubtract";
155}
156pub use self::numpad::*;
157
158pub mod function {
161 pub const ESCAPE: &'static str = "Escape";
162 pub const F1: &'static str = "F1";
163 pub const F2: &'static str = "F2";
164 pub const F3: &'static str = "F3";
165 pub const F4: &'static str = "F4";
166 pub const F5: &'static str = "F5";
167 pub const F6: &'static str = "F6";
168 pub const F7: &'static str = "F7";
169 pub const F8: &'static str = "F8";
170 pub const F9: &'static str = "F9";
171 pub const F10: &'static str = "F10";
172 pub const F11: &'static str = "F11";
173 pub const F12: &'static str = "F12";
174 pub const F13: &'static str = "F13";
175 pub const F14: &'static str = "F14";
176 pub const F15: &'static str = "F15";
177 pub const F16: &'static str = "F16";
178 pub const F17: &'static str = "F17";
179 pub const F18: &'static str = "F18";
180 pub const F19: &'static str = "F19";
181 pub const FN: &'static str = "Fn";
182 pub const FN_LOCK: &'static str = "FnLock";
183 pub const PRINT_SCREEN: &'static str = "PrintScreen";
184 pub const SCROLL_LOCK: &'static str = "ScrollLock";
185 pub const PAUSE: &'static str = "Pause";
186}
187pub use self::function::*;
188
189pub mod media {
192 pub const BROWSER_BACK: &'static str = "BrowserBack";
193 pub const BROWSER_FAVORITES: &'static str = "BrowserFavorites";
194 pub const BROWSER_FORWARD: &'static str = "BrowserForward";
195 pub const BROWSER_HOME: &'static str = "BrowserHome";
196 pub const BROWSER_REFRESH: &'static str = "BrowserRefresh";
197 pub const BROWSER_SEARCH: &'static str = "BrowserSearch";
198 pub const BROWSER_STOP: &'static str = "BrowserStop";
199 pub const EJECT: &'static str = "Eject";
200 pub const LAUNCH_APP1: &'static str = "LaunchApp1";
201 pub const LAUNCH_APP2: &'static str = "LaunchApp2";
202 pub const LAUNCH_MAIL: &'static str = "LaunchMail";
203 pub const MEDIA_PLAY_PAUSE: &'static str = "MediaPlayPause";
204 pub const MEDIA_SELECT: &'static str = "MediaSelect";
205 pub const MEDIA_STOP: &'static str = "MediaStop";
206 pub const MEDIA_TRACK_NEXT: &'static str = "MediaTrackNext";
207 pub const MEDIA_TRACK_PREVIOUS: &'static str = "MediaTrackPrevious";
208 pub const POWER: &'static str = "Power";
209 pub const SLEEP: &'static str = "Sleep";
210 pub const AUDIO_VOLUME_DOWN: &'static str = "AudioVolumeDown";
211 pub const AUDIO_VOLUME_MUTE: &'static str = "AudioVolumeMute";
212 pub const AUDIO_VOLUME_UP: &'static str = "AudioVolumeUp";
213 pub const WAKE_UP: &'static str = "WakeUp";
214}
215pub use self::media::*;
216
217#[cfg(any(feature = "legacy", doc))]
220#[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
221pub mod legacy {
222 pub const HYPER: &'static str = "Hyper";
223 pub const SUPER: &'static str = "Super";
224 pub const TURBO: &'static str = "Turbo";
225 pub const ABORT: &'static str = "Abort";
226 pub const RESUME: &'static str = "Resume";
227 pub const SUSPEND: &'static str = "Suspend";
228 pub const AGAIN: &'static str = "Again";
229 pub const COPY: &'static str = "Copy";
230 pub const CUT: &'static str = "Cut";
231 pub const FIND: &'static str = "Find";
232 pub const OPEN: &'static str = "Open";
233 pub const PASTE: &'static str = "Paste";
234 pub const PROPS: &'static str = "Props";
235 pub const SELECT: &'static str = "Select";
236 pub const UNDO: &'static str = "Undo";
237}
238#[cfg(any(feature = "legacy", doc))]
239#[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
240pub use self::legacy::*;
241
242#[cfg(any(feature = "non_standard_intl", doc))]
245#[cfg_attr(doc_cfg, doc(cfg(feature = "non_standard_intl")))]
246pub mod non_standard_intl {
247 pub const HIRAGANA: &'static str = "Hiragana";
248 pub const KATAKANA: &'static str = "Katakana";
249}
250#[cfg(any(feature = "non_standard_intl", doc))]
251#[cfg_attr(doc_cfg, doc(cfg(feature = "non_standard_intl")))]
252pub use self::non_standard_intl::*;
253
254pub mod special {
258 pub const UNIDENTIFIED: &'static str = "Unidentified";
259}
260pub use self::special::*;
261
262#[cfg(any(feature = "enum", doc))]
268#[cfg_attr(doc_cfg, doc(cfg(feature = "enum")))]
269#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EnumCount, FromRepr)]
270#[repr(u8)]
271pub enum KeyboardEventCode {
272 Backquote,
274 Backslash,
276 Backspace,
278 BracketLeft,
280 BracketRight,
282 Comma,
284 Digit0,
286 Digit1,
288 Digit2,
290 Digit3,
292 Digit4,
294 Digit5,
296 Digit6,
298 Digit7,
300 Digit8,
302 Digit9,
304 Equal,
306 IntlBackslash,
308 IntlRo,
310 IntlYen,
312 KeyA,
314 KeyB,
316 KeyC,
318 KeyD,
320 KeyE,
322 KeyF,
324 KeyG,
326 KeyH,
328 KeyI,
330 KeyJ,
332 KeyK,
334 KeyL,
336 KeyM,
338 KeyN,
340 KeyO,
342 KeyP,
344 KeyQ,
346 KeyR,
348 KeyS,
350 KeyT,
352 KeyU,
354 KeyV,
356 KeyW,
358 KeyX,
360 KeyY,
362 KeyZ,
364 Minus,
366 Period,
368 Quote,
370 Semicolon,
372 Slash,
374 AltLeft,
376 AltRight,
378 CapsLock,
380 ContextMenu,
382 ControlLeft,
384 ControlRight,
386 Enter,
388 MetaLeft,
390 MetaRight,
392 ShiftLeft,
394 ShiftRight,
396 Space,
398 Tab,
400 Convert,
402 KanaMode,
404 Lang1,
406 Lang2,
408 Lang3,
410 Lang4,
412 Lang5,
414 NonConvert,
416 Delete,
418 End,
420 Help,
422 Home,
424 Insert,
426 PageDown,
428 PageUp,
430 ArrowDown,
432 ArrowLeft,
434 ArrowRight,
436 ArrowUp,
438 NumLock,
440 Numpad0,
442 Numpad1,
444 Numpad2,
446 Numpad3,
448 Numpad4,
450 Numpad5,
452 Numpad6,
454 Numpad7,
456 Numpad8,
458 Numpad9,
460 NumpadAdd,
462 NumpadBackspace,
464 NumpadClear,
466 NumpadClearEntry,
468 NumpadComma,
470 NumpadDecimal,
472 NumpadDivide,
474 NumpadEnter,
476 NumpadEqual,
478 NumpadHash,
480 NumpadMemoryAdd,
482 NumpadMemoryClear,
484 NumpadMemoryRecall,
486 NumpadMemoryStore,
488 NumpadMemorySubtract,
490 NumpadMultiply,
492 NumpadParenLeft,
494 NumpadParenRight,
496 NumpadStar,
498 NumpadSubtract,
500 Escape,
502 F1,
504 F2,
506 F3,
508 F4,
510 F5,
512 F6,
514 F7,
516 F8,
518 F9,
520 F10,
522 F11,
524 F12,
526 F13,
528 F14,
530 F15,
532 F16,
534 F17,
536 F18,
538 F19,
540 Fn,
542 FnLock,
544 PrintScreen,
546 ScrollLock,
548 Pause,
550 BrowserBack,
552 BrowserFavorites,
554 BrowserForward,
556 BrowserHome,
558 BrowserRefresh,
560 BrowserSearch,
562 BrowserStop,
564 Eject,
566 LaunchApp1,
568 LaunchApp2,
570 LaunchMail,
572 MediaPlayPause,
574 MediaSelect,
576 MediaStop,
578 MediaTrackNext,
580 MediaTrackPrevious,
582 Power,
584 Sleep,
586 AudioVolumeDown,
588 AudioVolumeMute,
590 AudioVolumeUp,
592 WakeUp,
594 #[cfg(any(feature = "legacy", doc))]
595 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
596 Hyper,
598 #[cfg(any(feature = "legacy", doc))]
599 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
600 Super,
602 #[cfg(any(feature = "legacy", doc))]
603 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
604 Turbo,
606 #[cfg(any(feature = "legacy", doc))]
607 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
608 Abort,
610 #[cfg(any(feature = "legacy", doc))]
611 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
612 Resume,
614 #[cfg(any(feature = "legacy", doc))]
615 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
616 Suspend,
618 #[cfg(any(feature = "legacy", doc))]
619 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
620 Again,
622 #[cfg(any(feature = "legacy", doc))]
623 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
624 Copy,
626 #[cfg(any(feature = "legacy", doc))]
627 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
628 Cut,
630 #[cfg(any(feature = "legacy", doc))]
631 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
632 Find,
634 #[cfg(any(feature = "legacy", doc))]
635 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
636 Open,
638 #[cfg(any(feature = "legacy", doc))]
639 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
640 Paste,
642 #[cfg(any(feature = "legacy", doc))]
643 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
644 Props,
646 #[cfg(any(feature = "legacy", doc))]
647 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
648 Select,
650 #[cfg(any(feature = "legacy", doc))]
651 #[cfg_attr(doc_cfg, doc(cfg(feature = "legacy")))]
652 Undo,
654 #[cfg(any(feature = "non_standard_intl", doc))]
655 #[cfg_attr(doc_cfg, doc(cfg(feature = "non_standard_intl")))]
656 Hiragana,
658 #[cfg(any(feature = "non_standard_intl", doc))]
659 #[cfg_attr(doc_cfg, doc(cfg(feature = "non_standard_intl")))]
660 Katakana,
662 Unidentified,
664}