keyboard_types/
named_key.rs

1
2// AUTO GENERATED CODE - DO NOT EDIT
3#![cfg_attr(rustfmt, rustfmt_skip)]
4#![allow(clippy::doc_markdown)]
5#![allow(deprecated)]
6
7use core::fmt::{self, Display};
8use core::str::FromStr;
9#[cfg(not(feature = "std"))]
10use core::error::Error;
11#[cfg(feature = "std")]
12use std::error::Error;
13
14/// Key represents the meaning of a keypress.
15///
16/// Specification:
17/// <https://w3c.github.io/uievents-key/>
18///
19/// Note: "Space" is deliberately not a named key (to match the specification), use
20/// `Key::Character(" ")` instead.
21#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
22#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
23#[non_exhaustive]
24pub enum NamedKey {
25    /// This key value is used when an implementation is unable to
26    /// identify another key value, due to either hardware,
27    /// platform, or software constraints.
28    Unidentified,
29    /// The <kbd>Alt</kbd> (Alternative) key.<br/> This key enables the alternate modifier function for interpreting concurrent or subsequent keyboard input.<br/> This key value is also used for the Apple <kbd>Option</kbd> key.
30    Alt,
31    /// The Alternate Graphics (<kbd>AltGr</kbd> or <kbd>AltGraph</kbd>) key.
32    /// This key is used enable the ISO Level 3 shift modifier (the standard <kbd>Shift</kbd> key is the level 2 modifier).
33    /// See [ISO9995-1].
34    AltGraph,
35    /// The <kbd>Caps Lock</kbd> (Capital) key.
36    /// Toggle capital character lock function for interpreting subsequent keyboard input event.
37    CapsLock,
38    /// The <kbd>Control</kbd> or <kbd>Ctrl</kbd> key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.
39    Control,
40    /// The Function switch <kbd>Fn</kbd> key.<br/> Activating this key simultaneously with another key changes that key’s value to an alternate character or function.
41    /// This key is often handled directly in the keyboard hardware and does not usually generate key events.
42    Fn,
43    /// The Function-Lock (<kbd>FnLock</kbd> or <kbd>F-Lock</kbd>) key.
44    /// Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function.
45    /// This key is often handled directly in the keyboard hardware and does not usually generate key events.
46    FnLock,
47    /// The <kbd>Meta</kbd> key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input.
48    /// This key value is used for the <q>Windows Logo</q> key and the Apple <kbd>Command</kbd> or <kbd>⌘</kbd> key.
49    /// In Linux (XKB) terminology, this is often referred to as "Super".
50    #[doc(alias = "Super")]
51    Meta,
52    /// The <kbd>NumLock</kbd> or Number Lock key, to toggle numpad mode function for interpreting subsequent keyboard input.
53    NumLock,
54    /// The <kbd>Scroll Lock</kbd> key, to toggle between scrolling and cursor movement modes.
55    ScrollLock,
56    /// The <kbd>Shift</kbd> key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.
57    Shift,
58    /// The Symbol modifier key (used on some virtual keyboards).
59    Symbol,
60    /// The Symbol Lock key.
61    SymbolLock,
62    /// The <kbd>Hyper</kbd> key.
63    #[deprecated = "marked as legacy in the spec, use Meta instead"]
64    Hyper,
65    /// The <kbd>Super</kbd> key.
66    #[deprecated = "marked as legacy in the spec, use Meta instead"]
67    Super,
68    /// The <kbd>Enter</kbd> or <kbd>↵</kbd> key, to activate current selection or accept current input.<br/> This key value is also used for the <kbd>Return</kbd> (Macintosh numpad) key.<br/> This key value is also used for the Android <code class="android">KEYCODE_DPAD_CENTER</code>.
69    #[doc(alias = "Return")]
70    Enter,
71    /// The Horizontal Tabulation <kbd>Tab</kbd> key.
72    Tab,
73    /// The down arrow key, to navigate or traverse downward. (<code class="android">KEYCODE_DPAD_DOWN</code>)
74    ArrowDown,
75    /// The left arrow key, to navigate or traverse leftward. (<code class="android">KEYCODE_DPAD_LEFT</code>)
76    ArrowLeft,
77    /// The right arrow key, to navigate or traverse rightward. (<code class="android">KEYCODE_DPAD_RIGHT</code>)
78    ArrowRight,
79    /// The up arrow key, to navigate or traverse upward. (<code class="android">KEYCODE_DPAD_UP</code>)
80    ArrowUp,
81    /// The End key, used with keyboard entry to go to the end of content (<code class="android">KEYCODE_MOVE_END</code>).
82    End,
83    /// The Home key, used with keyboard entry, to go to start of content (<code class="android">KEYCODE_MOVE_HOME</code>).<br/> For the mobile phone <kbd>Home</kbd> key (which goes to the phone’s main screen), use [`GoHome`][NamedKey::GoHome].
84    Home,
85    /// The Page Down key, to scroll down or display next page of content.
86    PageDown,
87    /// The Page Up key, to scroll up or display previous page of content.
88    PageUp,
89    /// The Backspace key. This key value is also used for the key labeled <kbd>Delete</kbd> on MacOS keyboards.
90    Backspace,
91    /// Remove the currently selected input.
92    Clear,
93    /// Copy the current selection. (<code class="appcommand">APPCOMMAND_COPY</code>)
94    Copy,
95    /// The Cursor Select (Crsel) key.
96    CrSel,
97    /// Cut the current selection. (<code class="appcommand">APPCOMMAND_CUT</code>)
98    Cut,
99    /// The Delete (Del) Key.
100    /// This key value is also used for the key labeled <kbd>Delete</kbd> on MacOS keyboards when modified by the <kbd>Fn</kbd> key.
101    Delete,
102    /// The Erase to End of Field key.
103    /// This key deletes all characters from the current cursor position to the end of the current field.
104    EraseEof,
105    /// The Extend Selection (Exsel) key.
106    ExSel,
107    /// The Insert (Ins) key, to toggle between text modes for insertion or overtyping. (<code class="android">KEYCODE_INSERT</code>)
108    Insert,
109    /// The Paste key. (<code class="appcommand">APPCOMMAND_PASTE</code>)
110    Paste,
111    /// Redo the last action. (<code class="appcommand">APPCOMMAND_REDO</code>)
112    Redo,
113    /// Undo the last action. (<code class="appcommand">APPCOMMAND_UNDO</code>)
114    Undo,
115    /// The Accept (Commit, OK) key. Accept current option or input method sequence conversion.
116    Accept,
117    /// The Again key, to redo or repeat an action.
118    Again,
119    /// The Attention (Attn) key.
120    Attn,
121    /// The Cancel key.
122    Cancel,
123    /// Show the application’s context menu.
124    /// This key is commonly found between the right <kbd>Meta</kbd> key and the right <kbd>Control</kbd> key.
125    ContextMenu,
126    /// The <kbd>Esc</kbd> key. This key was originally used to initiate an escape sequence, but is
127    /// now more generally used to exit or "escape" the current context, such as closing a dialog
128    /// or exiting full screen mode.
129    Escape,
130    /// The Execute key.
131    Execute,
132    /// Open the Find dialog. (<code class="appcommand">APPCOMMAND_FIND</code>)
133    Find,
134    /// Open a help dialog or toggle display of help information. (<code class="appcommand"><code class="appcommand">APPCOMMAND_HELP</code></code>, <code class="android"><code class="android">KEYCODE_HELP</code></code>)
135    Help,
136    /// Pause the current state or application (as appropriate).
137    /// <p class="note" role="note">Do not use this value for the <kbd>Pause</kbd> button on media controllers. Use [`MediaPause`][NamedKey::MediaPause] instead.</p>
138    Pause,
139    /// Play or resume the current state or application (as appropriate).
140    /// <p class="note" role="note">Do not use this value for the <kbd>Play</kbd> button on media controllers. Use [`MediaPlay`][NamedKey::MediaPlay] instead.</p>
141    Play,
142    /// The properties (Props) key.
143    Props,
144    /// The Select key.
145    Select,
146    /// The ZoomIn key. (<code class="android">KEYCODE_ZOOM_IN</code>)
147    ZoomIn,
148    /// The ZoomOut key. (<code class="android">KEYCODE_ZOOM_OUT</code>)
149    ZoomOut,
150    /// The Brightness Down key. Typically controls the display brightness. (<code class="android">KEYCODE_BRIGHTNESS_DOWN</code>)
151    BrightnessDown,
152    /// The Brightness Up key. Typically controls the display brightness. (<code class="android">KEYCODE_BRIGHTNESS_UP</code>)
153    BrightnessUp,
154    /// Toggle removable media to eject (open) and insert (close) state. (<code class="android">KEYCODE_MEDIA_EJECT</code>)
155    Eject,
156    /// The LogOff key.
157    LogOff,
158    /// Toggle power state. (<code class="android">KEYCODE_POWER</code>)
159    /// <p class="note" role="note">Note: Some devices might not expose this key to the operating environment.</p>
160    Power,
161    /// The <kbd>PowerOff</kbd> key. Sometime called <kbd>PowerDown</kbd>.
162    PowerOff,
163    /// The <kbd>Print Screen</kbd> or <kbd>SnapShot</kbd> key, to initiate print-screen function.
164    PrintScreen,
165    /// The Hibernate key.
166    /// This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown.
167    Hibernate,
168    /// The Standby key.
169    /// This key turns off the display and places the computer into a low-power mode without completely shutting down.
170    /// It is sometimes labelled <kbd>Suspend</kbd> or <kbd>Sleep</kbd> key. (<code class="android"><code class="android">KEYCODE_SLEEP</code></code>)
171    Standby,
172    /// The WakeUp key. (<code class="android">KEYCODE_WAKEUP</code>)
173    WakeUp,
174    /// The All Candidates key, to initiate the multi-candidate mode.
175    AllCandidates,
176    /// The Alphanumeric key.
177    Alphanumeric,
178    /// The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points.
179    CodeInput,
180    /// The Compose key, also known as <em>Multi_key</em> on the X Window System.
181    /// This key acts in a manner similar to a
182    /// dead key, triggering a mode where subsequent key presses are combined to produce a different character.
183    Compose,
184    /// The Convert key, to convert the current input method sequence.
185    Convert,
186    /// A dead key combining key. It may be any combining key from any keyboard layout. For example, on a
187    /// PC/AT French keyboard, using a French mapping and without any modifier activated, this is the key value <code class="unicode">U+0302</code> COMBINING CIRCUMFLEX ACCENT. In another layout this might be a different unicode combining key.<br/> For applications that need to differentiate between specific combining characters, the associated compositionupdate event’s data attribute provides the specific key value.
188    Dead,
189    /// The Final Mode <kbd>Final</kbd> key used on some Asian keyboards, to enable the final mode for IMEs.
190    FinalMode,
191    /// Switch to the first character group. (ISO/IEC 9995)
192    GroupFirst,
193    /// Switch to the last character group. (ISO/IEC 9995)
194    GroupLast,
195    /// Switch to the next character group. (ISO/IEC 9995)
196    GroupNext,
197    /// Switch to the previous character group. (ISO/IEC 9995)
198    GroupPrevious,
199    /// The Mode Change key, to toggle between or cycle through input modes of IMEs.
200    ModeChange,
201    /// The Next Candidate function key.
202    NextCandidate,
203    /// The NonConvert ("Don’t Convert") key, to accept current input method sequence without conversion in IMEs.
204    NonConvert,
205    /// The Previous Candidate function key.
206    PreviousCandidate,
207    /// The Process key.
208    Process,
209    /// The Single Candidate function key.
210    SingleCandidate,
211    /// The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes.
212    HangulMode,
213    /// The Hanja (Korean characters) Mode key.
214    HanjaMode,
215    /// The Junja (Korean characters) Mode key.
216    JunjaMode,
217    /// The Eisu key. This key may close the IME, but its purpose
218    /// is defined by the current IME. (<code class="android">KEYCODE_EISU</code>)
219    Eisu,
220    /// The (Half-Width) Characters key.
221    Hankaku,
222    /// The Hiragana (Japanese Kana characters) key.
223    Hiragana,
224    /// The Hiragana/Katakana toggle key. (<code class="android">KEYCODE_KATAKANA_HIRAGANA</code>)
225    HiraganaKatakana,
226    /// The Kana Mode (Kana Lock) key. This key is used to enter
227    /// hiragana mode (typically from romaji mode).
228    KanaMode,
229    /// The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.
230    /// This key is typically used to switch to a hiragana keyboard for
231    /// the purpose of converting input into kanji. (<code class="android">KEYCODE_KANA</code>)
232    KanjiMode,
233    /// The Katakana (Japanese Kana characters) key.
234    Katakana,
235    /// The Roman characters function key.
236    Romaji,
237    /// The Zenkaku (Full-Width) Characters key.
238    Zenkaku,
239    /// The Zenkaku/Hankaku (full-width/half-width) toggle key. (<code class="android">KEYCODE_ZENKAKU_HANKAKU</code>)
240    ZenkakuHankaku,
241    /// General purpose virtual function key, as index 1.
242    Soft1,
243    /// General purpose virtual function key, as index 2.
244    Soft2,
245    /// General purpose virtual function key, as index 3.
246    Soft3,
247    /// General purpose virtual function key, as index 4.
248    Soft4,
249    /// Select next (numerically or logically) lower channel. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_CHANNEL_DOWN</code></code>, <code class="android"><code class="android">KEYCODE_CHANNEL_DOWN</code></code>)
250    ChannelDown,
251    /// Select next (numerically or logically) higher channel. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_CHANNEL_UP</code></code>, <code class="android"><code class="android">KEYCODE_CHANNEL_UP</code></code>)
252    ChannelUp,
253    /// Close the current document or message (Note: This doesn’t close the application). (<code class="appcommand">APPCOMMAND_CLOSE</code>)
254    Close,
255    /// Open an editor to forward the current message. (<code class="appcommand">APPCOMMAND_FORWARD_MAIL</code>)
256    MailForward,
257    /// Open an editor to reply to the current message. (<code class="appcommand">APPCOMMAND_REPLY_TO_MAIL</code>)
258    MailReply,
259    /// Send the current message. (<code class="appcommand">APPCOMMAND_SEND_MAIL</code>)
260    MailSend,
261    /// Close the current media, for example to close a CD or DVD tray. (<code class="android">KEYCODE_MEDIA_CLOSE</code>)
262    MediaClose,
263    /// Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_FAST_FORWARD</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_FAST_FORWARD</code></code>)
264    MediaFastForward,
265    /// Pause the currently playing media. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_PAUSE</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_PAUSE</code></code>)
266    /// <p class="note" role="note">Media controller devices should use this value rather than [`Pause`][NamedKey::Pause] for their pause keys.</p>
267    MediaPause,
268    /// Initiate or continue media playback at normal speed, if not currently playing at normal speed. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_PLAY</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_PLAY</code></code>)
269    MediaPlay,
270    /// Toggle media between play and pause states. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_PLAY_PAUSE</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_PLAY_PAUSE</code></code>)
271    MediaPlayPause,
272    /// Initiate or resume recording of currently selected media. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_RECORD</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_RECORD</code></code>)
273    MediaRecord,
274    /// Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_REWIND</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_REWIND</code></code>)
275    MediaRewind,
276    /// Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_STOP</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_STOP</code></code>)
277    MediaStop,
278    /// Seek to next media or program track. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_NEXTTRACK</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_NEXT</code></code>)
279    MediaTrackNext,
280    /// Seek to previous media or program track. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MEDIA_PREVIOUSTRACK</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_PREVIOUS</code></code>)
281    MediaTrackPrevious,
282    /// Open a new document or message. (<code class="appcommand">APPCOMMAND_NEW</code>)
283    New,
284    /// Open an existing document or message. (<code class="appcommand">APPCOMMAND_OPEN</code>)
285    Open,
286    /// Print the current document or message. (<code class="appcommand">APPCOMMAND_PRINT</code>)
287    Print,
288    /// Save the current document or message. (<code class="appcommand">APPCOMMAND_SAVE</code>)
289    Save,
290    /// Spellcheck the current document or selection. (<code class="appcommand">APPCOMMAND_SPELL_CHECK</code>)
291    SpellCheck,
292    /// The <kbd>11</kbd> key found on media numpads that
293    /// have buttons from <kbd>1</kbd> ... <kbd>12</kbd>.
294    Key11,
295    /// The <kbd>12</kbd> key found on media numpads that
296    /// have buttons from <kbd>1</kbd> ... <kbd>12</kbd>.
297    Key12,
298    /// Adjust audio balance leftward. (<code class="vk">VK_AUDIO_BALANCE_LEFT</code>)
299    AudioBalanceLeft,
300    /// Adjust audio balance rightward. (<code class="vk">VK_AUDIO_BALANCE_RIGHT</code>)
301    AudioBalanceRight,
302    /// Decrease audio bass boost or cycle down through bass boost states. (<code class="appcommand"><code class="appcommand">APPCOMMAND_BASS_DOWN</code></code>, <code class="vk"><code class="vk">VK_BASS_BOOST_DOWN</code></code>)
303    AudioBassBoostDown,
304    /// Toggle bass boost on/off. (<code class="appcommand">APPCOMMAND_BASS_BOOST</code>)
305    AudioBassBoostToggle,
306    /// Increase audio bass boost or cycle up through bass boost states. (<code class="appcommand"><code class="appcommand">APPCOMMAND_BASS_UP</code></code>, <code class="vk"><code class="vk">VK_BASS_BOOST_UP</code></code>)
307    AudioBassBoostUp,
308    /// Adjust audio fader towards front. (<code class="vk">VK_FADER_FRONT</code>)
309    AudioFaderFront,
310    /// Adjust audio fader towards rear. (<code class="vk">VK_FADER_REAR</code>)
311    AudioFaderRear,
312    /// Advance surround audio mode to next available mode. (<code class="vk">VK_SURROUND_MODE_NEXT</code>)
313    AudioSurroundModeNext,
314    /// Decrease treble. (<code class="appcommand">APPCOMMAND_TREBLE_DOWN</code>)
315    AudioTrebleDown,
316    /// Increase treble. (<code class="appcommand">APPCOMMAND_TREBLE_UP</code>)
317    AudioTrebleUp,
318    /// Decrease audio volume. (<code class="appcommand"><code class="appcommand">APPCOMMAND_VOLUME_DOWN</code></code>, <code class="android"><code class="android">KEYCODE_VOLUME_DOWN</code></code>)
319    AudioVolumeDown,
320    /// Increase audio volume. (<code class="appcommand"><code class="appcommand">APPCOMMAND_VOLUME_UP</code></code>, <code class="android"><code class="android">KEYCODE_VOLUME_UP</code></code>)
321    AudioVolumeUp,
322    /// Toggle between muted state and prior volume level. (<code class="appcommand"><code class="appcommand">APPCOMMAND_VOLUME_MUTE</code></code>, <code class="android"><code class="android">KEYCODE_VOLUME_MUTE</code></code>)
323    AudioVolumeMute,
324    /// Toggle the microphone on/off. (<code class="appcommand">APPCOMMAND_MIC_ON_OFF_TOGGLE</code>)
325    MicrophoneToggle,
326    /// Decrease microphone volume. (<code class="appcommand">APPCOMMAND_MICROPHONE_VOLUME_DOWN</code>)
327    MicrophoneVolumeDown,
328    /// Increase microphone volume. (<code class="appcommand">APPCOMMAND_MICROPHONE_VOLUME_UP</code>)
329    MicrophoneVolumeUp,
330    /// Mute the microphone. (<code class="appcommand"><code class="appcommand">APPCOMMAND_MICROPHONE_VOLUME_MUTE</code></code>, <code class="android"><code class="android">KEYCODE_MUTE</code></code>)
331    MicrophoneVolumeMute,
332    /// Show correction list when a word is incorrectly identified. (<code class="appcommand">APPCOMMAND_CORRECTION_LIST</code>)
333    SpeechCorrectionList,
334    /// Toggle between dictation mode and command/control mode. (<code class="appcommand">APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE</code>)
335    SpeechInputToggle,
336    /// The first generic "LaunchApplication" key. This is commonly associated with launching "My Computer", and may have a computer symbol on the key. (<code class="appcommand">APPCOMMAND_LAUNCH_APP1</code>)
337    LaunchApplication1,
338    /// The second generic "LaunchApplication" key. This is commonly associated with launching "Calculator", and may have a calculator symbol on the key. (<code class="appcommand"><code class="appcommand">APPCOMMAND_LAUNCH_APP2</code></code>, <code class="android"><code class="android">KEYCODE_CALCULATOR</code></code>)
339    LaunchApplication2,
340    /// The "Calendar" key. (<code class="android">KEYCODE_CALENDAR</code>)
341    LaunchCalendar,
342    /// The "Contacts" key. (<code class="android">KEYCODE_CONTACTS</code>)
343    LaunchContacts,
344    /// The "Mail" key. (<code class="appcommand">APPCOMMAND_LAUNCH_MAIL</code>)
345    LaunchMail,
346    /// The "Media Player" key. (<code class="appcommand">APPCOMMAND_LAUNCH_MEDIA_SELECT</code>)
347    LaunchMediaPlayer,
348    /// The "Music Player" key.
349    LaunchMusicPlayer,
350    /// The "Phone" key.
351    LaunchPhone,
352    /// The "Screen Saver" key.
353    LaunchScreenSaver,
354    /// The "Spreadsheet" key.
355    LaunchSpreadsheet,
356    /// The "Web Browser" key.
357    LaunchWebBrowser,
358    /// The "WebCam" key.
359    LaunchWebCam,
360    /// The "Word Processor" key.
361    LaunchWordProcessor,
362    /// Navigate to previous content or page in current history. (<code class="appcommand">APPCOMMAND_BROWSER_BACKWARD</code>)
363    BrowserBack,
364    /// Open the list of browser favorites. (<code class="appcommand">APPCOMMAND_BROWSER_FAVORITES</code>)
365    BrowserFavorites,
366    /// Navigate to next content or page in current history. (<code class="appcommand">APPCOMMAND_BROWSER_FORWARD</code>)
367    BrowserForward,
368    /// Go to the user’s preferred home page. (<code class="appcommand">APPCOMMAND_BROWSER_HOME</code>)
369    BrowserHome,
370    /// Refresh the current page or content. (<code class="appcommand">APPCOMMAND_BROWSER_REFRESH</code>)
371    BrowserRefresh,
372    /// Call up the user’s preferred search page. (<code class="appcommand">APPCOMMAND_BROWSER_SEARCH</code>)
373    BrowserSearch,
374    /// Stop loading the current page or content. (<code class="appcommand">APPCOMMAND_BROWSER_STOP</code>)
375    BrowserStop,
376    /// The Application switch key, which provides a list of recent apps to switch between. (<code class="android">KEYCODE_APP_SWITCH</code>)
377    AppSwitch,
378    /// The Call key. (<code class="android">KEYCODE_CALL</code>)
379    Call,
380    /// The Camera key. (<code class="android">KEYCODE_CAMERA</code>)
381    Camera,
382    /// The Camera focus key. (<code class="android">KEYCODE_FOCUS</code>)
383    CameraFocus,
384    /// The End Call key. (<code class="android">KEYCODE_ENDCALL</code>)
385    EndCall,
386    /// The Back key. (<code class="android">KEYCODE_BACK</code>)
387    GoBack,
388    /// The Home key, which goes to the phone’s main screen. (<code class="android">KEYCODE_HOME</code>)
389    GoHome,
390    /// The Headset Hook key. (<code class="android">KEYCODE_HEADSETHOOK</code>)
391    HeadsetHook,
392    /// The Last Number Redial key.
393    LastNumberRedial,
394    /// The Notification key. (<code class="android">KEYCODE_NOTIFICATION</code>)
395    Notification,
396    /// Toggle between manner mode state: silent, vibrate, ring, ... (<code class="android">KEYCODE_MANNER_MODE</code>)
397    MannerMode,
398    /// The Voice Dial key.
399    VoiceDial,
400    /// Switch to viewing TV. (<code class="android">KEYCODE_TV</code>)
401    TV,
402    /// TV 3D Mode. (<code class="android">KEYCODE_3D_MODE</code>)
403    TV3DMode,
404    /// Toggle between antenna and cable input. (<code class="android">KEYCODE_TV_ANTENNA_CABLE</code>)
405    TVAntennaCable,
406    /// Audio description. (<code class="android">KEYCODE_TV_AUDIO_DESCRIPTION</code>)
407    TVAudioDescription,
408    /// Audio description mixing volume down. (<code class="android">KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN</code>)
409    TVAudioDescriptionMixDown,
410    /// Audio description mixing volume up. (<code class="android">KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP</code>)
411    TVAudioDescriptionMixUp,
412    /// Contents menu. (<code class="android">KEYCODE_TV_CONTENTS_MENU</code>)
413    TVContentsMenu,
414    /// Contents menu. (<code class="android">KEYCODE_TV_DATA_SERVICE</code>)
415    TVDataService,
416    /// Switch the input mode on an external TV. (<code class="android">KEYCODE_TV_INPUT</code>)
417    TVInput,
418    /// Switch to component input #1. (<code class="android">KEYCODE_TV_INPUT_COMPONENT_1</code>)
419    TVInputComponent1,
420    /// Switch to component input #2. (<code class="android">KEYCODE_TV_INPUT_COMPONENT_2</code>)
421    TVInputComponent2,
422    /// Switch to composite input #1. (<code class="android">KEYCODE_TV_INPUT_COMPOSITE_1</code>)
423    TVInputComposite1,
424    /// Switch to composite input #2. (<code class="android">KEYCODE_TV_INPUT_COMPOSITE_2</code>)
425    TVInputComposite2,
426    /// Switch to HDMI input #1. (<code class="android">KEYCODE_TV_INPUT_HDMI_1</code>)
427    TVInputHDMI1,
428    /// Switch to HDMI input #2. (<code class="android">KEYCODE_TV_INPUT_HDMI_2</code>)
429    TVInputHDMI2,
430    /// Switch to HDMI input #3. (<code class="android">KEYCODE_TV_INPUT_HDMI_3</code>)
431    TVInputHDMI3,
432    /// Switch to HDMI input #4. (<code class="android">KEYCODE_TV_INPUT_HDMI_4</code>)
433    TVInputHDMI4,
434    /// Switch to VGA input #1. (<code class="android">KEYCODE_TV_INPUT_VGA_1</code>)
435    TVInputVGA1,
436    /// Media context menu. (<code class="android">KEYCODE_TV_MEDIA_CONTEXT_MENU</code>)
437    TVMediaContext,
438    /// Toggle network. (<code class="android">KEYCODE_TV_NETWORK</code>)
439    TVNetwork,
440    /// Number entry. (<code class="android">KEYCODE_TV_NUMBER_ENTRY</code>)
441    TVNumberEntry,
442    /// Toggle the power on an external TV. (<code class="android">KEYCODE_TV_POWER</code>)
443    TVPower,
444    /// Radio. (<code class="android">KEYCODE_TV_RADIO_SERVICE</code>)
445    TVRadioService,
446    /// Satellite. (<code class="android">KEYCODE_TV_SATELLITE</code>)
447    TVSatellite,
448    /// Broadcast Satellite. (<code class="android">KEYCODE_TV_SATELLITE_BS</code>)
449    TVSatelliteBS,
450    /// Communication Satellite. (<code class="android">KEYCODE_TV_SATELLITE_CS</code>)
451    TVSatelliteCS,
452    /// Toggle between available satellites. (<code class="android">KEYCODE_TV_SATELLITE_SERVICE</code>)
453    TVSatelliteToggle,
454    /// Analog Terrestrial. (<code class="android">KEYCODE_TV_TERRESTRIAL_ANALOG</code>)
455    TVTerrestrialAnalog,
456    /// Digital Terrestrial. (<code class="android">KEYCODE_TV_TERRESTRIAL_DIGITAL</code>)
457    TVTerrestrialDigital,
458    /// Timer programming. (<code class="android">KEYCODE_TV_TIMER_PROGRAMMING</code>)
459    TVTimer,
460    /// Switch the input mode on an external AVR (audio/video receiver). (<code class="android">KEYCODE_AVR_INPUT</code>)
461    AVRInput,
462    /// Toggle the power on an external AVR (audio/video receiver). (<code class="android">KEYCODE_AVR_POWER</code>)
463    AVRPower,
464    /// General purpose color-coded media function key, as index 0 (red). (<code class="vk"><code class="vk">VK_COLORED_KEY_0</code></code>, <code class="android"><code class="android">KEYCODE_PROG_RED</code></code>)
465    ColorF0Red,
466    /// General purpose color-coded media function key, as index 1 (green). (<code class="vk"><code class="vk">VK_COLORED_KEY_1</code></code>, <code class="android"><code class="android">KEYCODE_PROG_GREEN</code></code>)
467    ColorF1Green,
468    /// General purpose color-coded media function key, as index 2 (yellow). (<code class="vk"><code class="vk">VK_COLORED_KEY_2</code></code>, <code class="android"><code class="android">KEYCODE_PROG_YELLOW</code></code>)
469    ColorF2Yellow,
470    /// General purpose color-coded media function key, as index 3 (blue). (<code class="vk"><code class="vk">VK_COLORED_KEY_3</code></code>, <code class="android"><code class="android">KEYCODE_PROG_BLUE</code></code>)
471    ColorF3Blue,
472    /// General purpose color-coded media function key, as index 4 (grey). (<code class="vk">VK_COLORED_KEY_4</code>)
473    ColorF4Grey,
474    /// General purpose color-coded media function key, as index 5 (brown). (<code class="vk">VK_COLORED_KEY_5</code>)
475    ColorF5Brown,
476    /// Toggle the display of Closed Captions. (<code class="vk"><code class="vk">VK_CC</code></code>, <code class="android"><code class="android">KEYCODE_CAPTIONS</code></code>)
477    ClosedCaptionToggle,
478    /// Adjust brightness of device, by toggling between or cycling through states. (<code class="vk">VK_DIMMER</code>)
479    Dimmer,
480    /// Swap video sources. (<code class="vk">VK_DISPLAY_SWAP</code>)
481    DisplaySwap,
482    /// Select Digital Video Rrecorder. (<code class="android">KEYCODE_DVR</code>)
483    DVR,
484    /// Exit the current application. (<code class="vk">VK_EXIT</code>)
485    Exit,
486    /// Clear program or content stored as favorite 0. (<code class="vk">VK_CLEAR_FAVORITE_0</code>)
487    FavoriteClear0,
488    /// Clear program or content stored as favorite 1. (<code class="vk">VK_CLEAR_FAVORITE_1</code>)
489    FavoriteClear1,
490    /// Clear program or content stored as favorite 2. (<code class="vk">VK_CLEAR_FAVORITE_2</code>)
491    FavoriteClear2,
492    /// Clear program or content stored as favorite 3. (<code class="vk">VK_CLEAR_FAVORITE_3</code>)
493    FavoriteClear3,
494    /// Select (recall) program or content stored as favorite 0. (<code class="vk">VK_RECALL_FAVORITE_0</code>)
495    FavoriteRecall0,
496    /// Select (recall) program or content stored as favorite 1. (<code class="vk">VK_RECALL_FAVORITE_1</code>)
497    FavoriteRecall1,
498    /// Select (recall) program or content stored as favorite 2. (<code class="vk">VK_RECALL_FAVORITE_2</code>)
499    FavoriteRecall2,
500    /// Select (recall) program or content stored as favorite 3. (<code class="vk">VK_RECALL_FAVORITE_3</code>)
501    FavoriteRecall3,
502    /// Store current program or content as favorite 0. (<code class="vk">VK_STORE_FAVORITE_0</code>)
503    FavoriteStore0,
504    /// Store current program or content as favorite 1. (<code class="vk">VK_STORE_FAVORITE_1</code>)
505    FavoriteStore1,
506    /// Store current program or content as favorite 2. (<code class="vk">VK_STORE_FAVORITE_2</code>)
507    FavoriteStore2,
508    /// Store current program or content as favorite 3. (<code class="vk">VK_STORE_FAVORITE_3</code>)
509    FavoriteStore3,
510    /// Toggle display of program or content guide. (<code class="vk"><code class="vk">VK_GUIDE</code></code>, <code class="android"><code class="android">KEYCODE_GUIDE</code></code>)
511    Guide,
512    /// If guide is active and displayed, then display next day’s content. (<code class="vk">VK_NEXT_DAY</code>)
513    GuideNextDay,
514    /// If guide is active and displayed, then display previous day’s content. (<code class="vk">VK_PREV_DAY</code>)
515    GuidePreviousDay,
516    /// Toggle display of information about currently selected context or media. (<code class="vk"><code class="vk">VK_INFO</code></code>, <code class="android"><code class="android">KEYCODE_INFO</code></code>)
517    Info,
518    /// Toggle instant replay. (<code class="vk">VK_INSTANT_REPLAY</code>)
519    InstantReplay,
520    /// Launch linked content, if available and appropriate. (<code class="vk">VK_LINK</code>)
521    Link,
522    /// List the current program. (<code class="vk">VK_LIST</code>)
523    ListProgram,
524    /// Toggle display listing of currently available live content or programs. (<code class="vk">VK_LIVE</code>)
525    LiveContent,
526    /// Lock or unlock current content or program. (<code class="vk">VK_LOCK</code>)
527    Lock,
528    /// Show a list of media applications: audio/video players and image viewers. (<code class="vk">VK_APPS</code>)
529    /// <p class="note" role="note">Do not confuse this key value with the Windows' <code class="vk"><code class="vk">VK_APPS</code></code> / <code class="vk"><code class="vk">VK_CONTEXT_MENU</code></code> key, which is encoded as [`ContextMenu`][NamedKey::ContextMenu].</p>
530    MediaApps,
531    /// Audio track key. (<code class="android">KEYCODE_MEDIA_AUDIO_TRACK</code>)
532    MediaAudioTrack,
533    /// Select previously selected channel or media. (<code class="vk"><code class="vk">VK_LAST</code></code>, <code class="android"><code class="android">KEYCODE_LAST_CHANNEL</code></code>)
534    MediaLast,
535    /// Skip backward to next content or program. (<code class="android">KEYCODE_MEDIA_SKIP_BACKWARD</code>)
536    MediaSkipBackward,
537    /// Skip forward to next content or program. (<code class="vk"><code class="vk">VK_SKIP</code></code>, <code class="android"><code class="android">KEYCODE_MEDIA_SKIP_FORWARD</code></code>)
538    MediaSkipForward,
539    /// Step backward to next content or program. (<code class="android">KEYCODE_MEDIA_STEP_BACKWARD</code>)
540    MediaStepBackward,
541    /// Step forward to next content or program. (<code class="android">KEYCODE_MEDIA_STEP_FORWARD</code>)
542    MediaStepForward,
543    /// Media top menu. (<code class="android">KEYCODE_MEDIA_TOP_MENU</code>)
544    MediaTopMenu,
545    /// Navigate in. (<code class="android">KEYCODE_NAVIGATE_IN</code>)
546    NavigateIn,
547    /// Navigate to next key. (<code class="android">KEYCODE_NAVIGATE_NEXT</code>)
548    NavigateNext,
549    /// Navigate out. (<code class="android">KEYCODE_NAVIGATE_OUT</code>)
550    NavigateOut,
551    /// Navigate to previous key. (<code class="android">KEYCODE_NAVIGATE_PREVIOUS</code>)
552    NavigatePrevious,
553    /// Cycle to next favorite channel (in favorites list). (<code class="vk">VK_NEXT_FAVORITE_CHANNEL</code>)
554    NextFavoriteChannel,
555    /// Cycle to next user profile (if there are multiple user profiles). (<code class="vk">VK_USER</code>)
556    NextUserProfile,
557    /// Access on-demand content or programs. (<code class="vk">VK_ON_DEMAND</code>)
558    OnDemand,
559    /// Pairing key to pair devices. (<code class="android">KEYCODE_PAIRING</code>)
560    Pairing,
561    /// Move picture-in-picture window down. (<code class="vk">VK_PINP_DOWN</code>)
562    PinPDown,
563    /// Move picture-in-picture window. (<code class="vk">VK_PINP_MOVE</code>)
564    PinPMove,
565    /// Toggle display of picture-in-picture window. (<code class="vk">VK_PINP_TOGGLE</code>)
566    PinPToggle,
567    /// Move picture-in-picture window up. (<code class="vk">VK_PINP_UP</code>)
568    PinPUp,
569    /// Decrease media playback speed. (<code class="vk">VK_PLAY_SPEED_DOWN</code>)
570    PlaySpeedDown,
571    /// Reset playback to normal speed. (<code class="vk">VK_PLAY_SPEED_RESET</code>)
572    PlaySpeedReset,
573    /// Increase media playback speed. (<code class="vk">VK_PLAY_SPEED_UP</code>)
574    PlaySpeedUp,
575    /// Toggle random media or content shuffle mode. (<code class="vk">VK_RANDOM_TOGGLE</code>)
576    RandomToggle,
577    /// Not a physical key, but this key code is sent when the remote control battery is low. (<code class="vk">VK_RC_LOW_BATTERY</code>)
578    RcLowBattery,
579    /// Toggle or cycle between media recording speeds. (<code class="vk">VK_RECORD_SPEED_NEXT</code>)
580    RecordSpeedNext,
581    /// Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). (<code class="vk">VK_RF_BYPASS</code>)
582    RfBypass,
583    /// Toggle scan channels mode. (<code class="vk">VK_SCAN_CHANNELS_TOGGLE</code>)
584    ScanChannelsToggle,
585    /// Advance display screen mode to next available mode. (<code class="vk">VK_SCREEN_MODE_NEXT</code>)
586    ScreenModeNext,
587    /// Toggle display of device settings screen. (<code class="vk"><code class="vk">VK_SETTINGS</code></code>, <code class="android"><code class="android">KEYCODE_SETTINGS</code></code>)
588    Settings,
589    /// Toggle split screen mode. (<code class="vk">VK_SPLIT_SCREEN_TOGGLE</code>)
590    SplitScreenToggle,
591    /// Switch the input mode on an external STB (set top box). (<code class="android">KEYCODE_STB_INPUT</code>)
592    STBInput,
593    /// Toggle the power on an external STB (set top box). (<code class="android">KEYCODE_STB_POWER</code>)
594    STBPower,
595    /// Toggle display of subtitles, if available. (<code class="vk">VK_SUBTITLE</code>)
596    Subtitle,
597    /// Toggle display of teletext, if available (<code class="vk"><code class="vk">VK_TELETEXT</code></code>, <code class="android"><code class="android">KEYCODE_TV_TELETEXT</code></code>).
598    Teletext,
599    /// Advance video mode to next available mode. (<code class="vk">VK_VIDEO_MODE_NEXT</code>)
600    VideoModeNext,
601    /// Cause device to identify itself in some manner, e.g., audibly or visibly. (<code class="vk">VK_WINK</code>)
602    Wink,
603    /// Toggle between full-screen and scaled content, or alter magnification level. (<code class="vk"><code class="vk">VK_ZOOM</code></code>, <code class="android"><code class="android">KEYCODE_TV_ZOOM_MODE</code></code>)
604    ZoomToggle,
605    /// The F1 key, a general purpose function key, as index 1.
606    F1,
607    /// The F2 key, a general purpose function key, as index 2.
608    F2,
609    /// The F3 key, a general purpose function key, as index 3.
610    F3,
611    /// The F4 key, a general purpose function key, as index 4.
612    F4,
613    /// The F5 key, a general purpose function key, as index 5.
614    F5,
615    /// The F6 key, a general purpose function key, as index 6.
616    F6,
617    /// The F7 key, a general purpose function key, as index 7.
618    F7,
619    /// The F8 key, a general purpose function key, as index 8.
620    F8,
621    /// The F9 key, a general purpose function key, as index 9.
622    F9,
623    /// The F10 key, a general purpose function key, as index 10.
624    F10,
625    /// The F11 key, a general purpose function key, as index 11.
626    F11,
627    /// The F12 key, a general purpose function key, as index 12.
628    F12,
629    /// The F13 key, a general purpose function key, as index 13.
630    F13,
631    /// The F14 key, a general purpose function key, as index 14.
632    F14,
633    /// The F15 key, a general purpose function key, as index 15.
634    F15,
635    /// The F16 key, a general purpose function key, as index 16.
636    F16,
637    /// The F17 key, a general purpose function key, as index 17.
638    F17,
639    /// The F18 key, a general purpose function key, as index 18.
640    F18,
641    /// The F19 key, a general purpose function key, as index 19.
642    F19,
643    /// The F20 key, a general purpose function key, as index 20.
644    F20,
645    /// The F21 key, a general purpose function key, as index 21.
646    F21,
647    /// The F22 key, a general purpose function key, as index 22.
648    F22,
649    /// The F23 key, a general purpose function key, as index 23.
650    F23,
651    /// The F24 key, a general purpose function key, as index 24.
652    F24,
653    /// The F25 key, a general purpose function key, as index 25.
654    F25,
655    /// The F26 key, a general purpose function key, as index 26.
656    F26,
657    /// The F27 key, a general purpose function key, as index 27.
658    F27,
659    /// The F28 key, a general purpose function key, as index 28.
660    F28,
661    /// The F29 key, a general purpose function key, as index 29.
662    F29,
663    /// The F30 key, a general purpose function key, as index 30.
664    F30,
665    /// The F31 key, a general purpose function key, as index 31.
666    F31,
667    /// The F32 key, a general purpose function key, as index 32.
668    F32,
669    /// The F33 key, a general purpose function key, as index 33.
670    F33,
671    /// The F34 key, a general purpose function key, as index 34.
672    F34,
673    /// The F35 key, a general purpose function key, as index 35.
674    F35,
675}
676
677
678impl Display for NamedKey {
679    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
680        use self::NamedKey::*;
681        match *self {
682            Unidentified => f.write_str("Unidentified"),
683            Alt => f.write_str("Alt"),
684            AltGraph => f.write_str("AltGraph"),
685            CapsLock => f.write_str("CapsLock"),
686            Control => f.write_str("Control"),
687            Fn => f.write_str("Fn"),
688            FnLock => f.write_str("FnLock"),
689            Meta => f.write_str("Meta"),
690            NumLock => f.write_str("NumLock"),
691            ScrollLock => f.write_str("ScrollLock"),
692            Shift => f.write_str("Shift"),
693            Symbol => f.write_str("Symbol"),
694            SymbolLock => f.write_str("SymbolLock"),
695            Hyper => f.write_str("Hyper"),
696            Super => f.write_str("Super"),
697            Enter => f.write_str("Enter"),
698            Tab => f.write_str("Tab"),
699            ArrowDown => f.write_str("ArrowDown"),
700            ArrowLeft => f.write_str("ArrowLeft"),
701            ArrowRight => f.write_str("ArrowRight"),
702            ArrowUp => f.write_str("ArrowUp"),
703            End => f.write_str("End"),
704            Home => f.write_str("Home"),
705            PageDown => f.write_str("PageDown"),
706            PageUp => f.write_str("PageUp"),
707            Backspace => f.write_str("Backspace"),
708            Clear => f.write_str("Clear"),
709            Copy => f.write_str("Copy"),
710            CrSel => f.write_str("CrSel"),
711            Cut => f.write_str("Cut"),
712            Delete => f.write_str("Delete"),
713            EraseEof => f.write_str("EraseEof"),
714            ExSel => f.write_str("ExSel"),
715            Insert => f.write_str("Insert"),
716            Paste => f.write_str("Paste"),
717            Redo => f.write_str("Redo"),
718            Undo => f.write_str("Undo"),
719            Accept => f.write_str("Accept"),
720            Again => f.write_str("Again"),
721            Attn => f.write_str("Attn"),
722            Cancel => f.write_str("Cancel"),
723            ContextMenu => f.write_str("ContextMenu"),
724            Escape => f.write_str("Escape"),
725            Execute => f.write_str("Execute"),
726            Find => f.write_str("Find"),
727            Help => f.write_str("Help"),
728            Pause => f.write_str("Pause"),
729            Play => f.write_str("Play"),
730            Props => f.write_str("Props"),
731            Select => f.write_str("Select"),
732            ZoomIn => f.write_str("ZoomIn"),
733            ZoomOut => f.write_str("ZoomOut"),
734            BrightnessDown => f.write_str("BrightnessDown"),
735            BrightnessUp => f.write_str("BrightnessUp"),
736            Eject => f.write_str("Eject"),
737            LogOff => f.write_str("LogOff"),
738            Power => f.write_str("Power"),
739            PowerOff => f.write_str("PowerOff"),
740            PrintScreen => f.write_str("PrintScreen"),
741            Hibernate => f.write_str("Hibernate"),
742            Standby => f.write_str("Standby"),
743            WakeUp => f.write_str("WakeUp"),
744            AllCandidates => f.write_str("AllCandidates"),
745            Alphanumeric => f.write_str("Alphanumeric"),
746            CodeInput => f.write_str("CodeInput"),
747            Compose => f.write_str("Compose"),
748            Convert => f.write_str("Convert"),
749            Dead => f.write_str("Dead"),
750            FinalMode => f.write_str("FinalMode"),
751            GroupFirst => f.write_str("GroupFirst"),
752            GroupLast => f.write_str("GroupLast"),
753            GroupNext => f.write_str("GroupNext"),
754            GroupPrevious => f.write_str("GroupPrevious"),
755            ModeChange => f.write_str("ModeChange"),
756            NextCandidate => f.write_str("NextCandidate"),
757            NonConvert => f.write_str("NonConvert"),
758            PreviousCandidate => f.write_str("PreviousCandidate"),
759            Process => f.write_str("Process"),
760            SingleCandidate => f.write_str("SingleCandidate"),
761            HangulMode => f.write_str("HangulMode"),
762            HanjaMode => f.write_str("HanjaMode"),
763            JunjaMode => f.write_str("JunjaMode"),
764            Eisu => f.write_str("Eisu"),
765            Hankaku => f.write_str("Hankaku"),
766            Hiragana => f.write_str("Hiragana"),
767            HiraganaKatakana => f.write_str("HiraganaKatakana"),
768            KanaMode => f.write_str("KanaMode"),
769            KanjiMode => f.write_str("KanjiMode"),
770            Katakana => f.write_str("Katakana"),
771            Romaji => f.write_str("Romaji"),
772            Zenkaku => f.write_str("Zenkaku"),
773            ZenkakuHankaku => f.write_str("ZenkakuHankaku"),
774            Soft1 => f.write_str("Soft1"),
775            Soft2 => f.write_str("Soft2"),
776            Soft3 => f.write_str("Soft3"),
777            Soft4 => f.write_str("Soft4"),
778            ChannelDown => f.write_str("ChannelDown"),
779            ChannelUp => f.write_str("ChannelUp"),
780            Close => f.write_str("Close"),
781            MailForward => f.write_str("MailForward"),
782            MailReply => f.write_str("MailReply"),
783            MailSend => f.write_str("MailSend"),
784            MediaClose => f.write_str("MediaClose"),
785            MediaFastForward => f.write_str("MediaFastForward"),
786            MediaPause => f.write_str("MediaPause"),
787            MediaPlay => f.write_str("MediaPlay"),
788            MediaPlayPause => f.write_str("MediaPlayPause"),
789            MediaRecord => f.write_str("MediaRecord"),
790            MediaRewind => f.write_str("MediaRewind"),
791            MediaStop => f.write_str("MediaStop"),
792            MediaTrackNext => f.write_str("MediaTrackNext"),
793            MediaTrackPrevious => f.write_str("MediaTrackPrevious"),
794            New => f.write_str("New"),
795            Open => f.write_str("Open"),
796            Print => f.write_str("Print"),
797            Save => f.write_str("Save"),
798            SpellCheck => f.write_str("SpellCheck"),
799            Key11 => f.write_str("Key11"),
800            Key12 => f.write_str("Key12"),
801            AudioBalanceLeft => f.write_str("AudioBalanceLeft"),
802            AudioBalanceRight => f.write_str("AudioBalanceRight"),
803            AudioBassBoostDown => f.write_str("AudioBassBoostDown"),
804            AudioBassBoostToggle => f.write_str("AudioBassBoostToggle"),
805            AudioBassBoostUp => f.write_str("AudioBassBoostUp"),
806            AudioFaderFront => f.write_str("AudioFaderFront"),
807            AudioFaderRear => f.write_str("AudioFaderRear"),
808            AudioSurroundModeNext => f.write_str("AudioSurroundModeNext"),
809            AudioTrebleDown => f.write_str("AudioTrebleDown"),
810            AudioTrebleUp => f.write_str("AudioTrebleUp"),
811            AudioVolumeDown => f.write_str("AudioVolumeDown"),
812            AudioVolumeUp => f.write_str("AudioVolumeUp"),
813            AudioVolumeMute => f.write_str("AudioVolumeMute"),
814            MicrophoneToggle => f.write_str("MicrophoneToggle"),
815            MicrophoneVolumeDown => f.write_str("MicrophoneVolumeDown"),
816            MicrophoneVolumeUp => f.write_str("MicrophoneVolumeUp"),
817            MicrophoneVolumeMute => f.write_str("MicrophoneVolumeMute"),
818            SpeechCorrectionList => f.write_str("SpeechCorrectionList"),
819            SpeechInputToggle => f.write_str("SpeechInputToggle"),
820            LaunchApplication1 => f.write_str("LaunchApplication1"),
821            LaunchApplication2 => f.write_str("LaunchApplication2"),
822            LaunchCalendar => f.write_str("LaunchCalendar"),
823            LaunchContacts => f.write_str("LaunchContacts"),
824            LaunchMail => f.write_str("LaunchMail"),
825            LaunchMediaPlayer => f.write_str("LaunchMediaPlayer"),
826            LaunchMusicPlayer => f.write_str("LaunchMusicPlayer"),
827            LaunchPhone => f.write_str("LaunchPhone"),
828            LaunchScreenSaver => f.write_str("LaunchScreenSaver"),
829            LaunchSpreadsheet => f.write_str("LaunchSpreadsheet"),
830            LaunchWebBrowser => f.write_str("LaunchWebBrowser"),
831            LaunchWebCam => f.write_str("LaunchWebCam"),
832            LaunchWordProcessor => f.write_str("LaunchWordProcessor"),
833            BrowserBack => f.write_str("BrowserBack"),
834            BrowserFavorites => f.write_str("BrowserFavorites"),
835            BrowserForward => f.write_str("BrowserForward"),
836            BrowserHome => f.write_str("BrowserHome"),
837            BrowserRefresh => f.write_str("BrowserRefresh"),
838            BrowserSearch => f.write_str("BrowserSearch"),
839            BrowserStop => f.write_str("BrowserStop"),
840            AppSwitch => f.write_str("AppSwitch"),
841            Call => f.write_str("Call"),
842            Camera => f.write_str("Camera"),
843            CameraFocus => f.write_str("CameraFocus"),
844            EndCall => f.write_str("EndCall"),
845            GoBack => f.write_str("GoBack"),
846            GoHome => f.write_str("GoHome"),
847            HeadsetHook => f.write_str("HeadsetHook"),
848            LastNumberRedial => f.write_str("LastNumberRedial"),
849            Notification => f.write_str("Notification"),
850            MannerMode => f.write_str("MannerMode"),
851            VoiceDial => f.write_str("VoiceDial"),
852            TV => f.write_str("TV"),
853            TV3DMode => f.write_str("TV3DMode"),
854            TVAntennaCable => f.write_str("TVAntennaCable"),
855            TVAudioDescription => f.write_str("TVAudioDescription"),
856            TVAudioDescriptionMixDown => f.write_str("TVAudioDescriptionMixDown"),
857            TVAudioDescriptionMixUp => f.write_str("TVAudioDescriptionMixUp"),
858            TVContentsMenu => f.write_str("TVContentsMenu"),
859            TVDataService => f.write_str("TVDataService"),
860            TVInput => f.write_str("TVInput"),
861            TVInputComponent1 => f.write_str("TVInputComponent1"),
862            TVInputComponent2 => f.write_str("TVInputComponent2"),
863            TVInputComposite1 => f.write_str("TVInputComposite1"),
864            TVInputComposite2 => f.write_str("TVInputComposite2"),
865            TVInputHDMI1 => f.write_str("TVInputHDMI1"),
866            TVInputHDMI2 => f.write_str("TVInputHDMI2"),
867            TVInputHDMI3 => f.write_str("TVInputHDMI3"),
868            TVInputHDMI4 => f.write_str("TVInputHDMI4"),
869            TVInputVGA1 => f.write_str("TVInputVGA1"),
870            TVMediaContext => f.write_str("TVMediaContext"),
871            TVNetwork => f.write_str("TVNetwork"),
872            TVNumberEntry => f.write_str("TVNumberEntry"),
873            TVPower => f.write_str("TVPower"),
874            TVRadioService => f.write_str("TVRadioService"),
875            TVSatellite => f.write_str("TVSatellite"),
876            TVSatelliteBS => f.write_str("TVSatelliteBS"),
877            TVSatelliteCS => f.write_str("TVSatelliteCS"),
878            TVSatelliteToggle => f.write_str("TVSatelliteToggle"),
879            TVTerrestrialAnalog => f.write_str("TVTerrestrialAnalog"),
880            TVTerrestrialDigital => f.write_str("TVTerrestrialDigital"),
881            TVTimer => f.write_str("TVTimer"),
882            AVRInput => f.write_str("AVRInput"),
883            AVRPower => f.write_str("AVRPower"),
884            ColorF0Red => f.write_str("ColorF0Red"),
885            ColorF1Green => f.write_str("ColorF1Green"),
886            ColorF2Yellow => f.write_str("ColorF2Yellow"),
887            ColorF3Blue => f.write_str("ColorF3Blue"),
888            ColorF4Grey => f.write_str("ColorF4Grey"),
889            ColorF5Brown => f.write_str("ColorF5Brown"),
890            ClosedCaptionToggle => f.write_str("ClosedCaptionToggle"),
891            Dimmer => f.write_str("Dimmer"),
892            DisplaySwap => f.write_str("DisplaySwap"),
893            DVR => f.write_str("DVR"),
894            Exit => f.write_str("Exit"),
895            FavoriteClear0 => f.write_str("FavoriteClear0"),
896            FavoriteClear1 => f.write_str("FavoriteClear1"),
897            FavoriteClear2 => f.write_str("FavoriteClear2"),
898            FavoriteClear3 => f.write_str("FavoriteClear3"),
899            FavoriteRecall0 => f.write_str("FavoriteRecall0"),
900            FavoriteRecall1 => f.write_str("FavoriteRecall1"),
901            FavoriteRecall2 => f.write_str("FavoriteRecall2"),
902            FavoriteRecall3 => f.write_str("FavoriteRecall3"),
903            FavoriteStore0 => f.write_str("FavoriteStore0"),
904            FavoriteStore1 => f.write_str("FavoriteStore1"),
905            FavoriteStore2 => f.write_str("FavoriteStore2"),
906            FavoriteStore3 => f.write_str("FavoriteStore3"),
907            Guide => f.write_str("Guide"),
908            GuideNextDay => f.write_str("GuideNextDay"),
909            GuidePreviousDay => f.write_str("GuidePreviousDay"),
910            Info => f.write_str("Info"),
911            InstantReplay => f.write_str("InstantReplay"),
912            Link => f.write_str("Link"),
913            ListProgram => f.write_str("ListProgram"),
914            LiveContent => f.write_str("LiveContent"),
915            Lock => f.write_str("Lock"),
916            MediaApps => f.write_str("MediaApps"),
917            MediaAudioTrack => f.write_str("MediaAudioTrack"),
918            MediaLast => f.write_str("MediaLast"),
919            MediaSkipBackward => f.write_str("MediaSkipBackward"),
920            MediaSkipForward => f.write_str("MediaSkipForward"),
921            MediaStepBackward => f.write_str("MediaStepBackward"),
922            MediaStepForward => f.write_str("MediaStepForward"),
923            MediaTopMenu => f.write_str("MediaTopMenu"),
924            NavigateIn => f.write_str("NavigateIn"),
925            NavigateNext => f.write_str("NavigateNext"),
926            NavigateOut => f.write_str("NavigateOut"),
927            NavigatePrevious => f.write_str("NavigatePrevious"),
928            NextFavoriteChannel => f.write_str("NextFavoriteChannel"),
929            NextUserProfile => f.write_str("NextUserProfile"),
930            OnDemand => f.write_str("OnDemand"),
931            Pairing => f.write_str("Pairing"),
932            PinPDown => f.write_str("PinPDown"),
933            PinPMove => f.write_str("PinPMove"),
934            PinPToggle => f.write_str("PinPToggle"),
935            PinPUp => f.write_str("PinPUp"),
936            PlaySpeedDown => f.write_str("PlaySpeedDown"),
937            PlaySpeedReset => f.write_str("PlaySpeedReset"),
938            PlaySpeedUp => f.write_str("PlaySpeedUp"),
939            RandomToggle => f.write_str("RandomToggle"),
940            RcLowBattery => f.write_str("RcLowBattery"),
941            RecordSpeedNext => f.write_str("RecordSpeedNext"),
942            RfBypass => f.write_str("RfBypass"),
943            ScanChannelsToggle => f.write_str("ScanChannelsToggle"),
944            ScreenModeNext => f.write_str("ScreenModeNext"),
945            Settings => f.write_str("Settings"),
946            SplitScreenToggle => f.write_str("SplitScreenToggle"),
947            STBInput => f.write_str("STBInput"),
948            STBPower => f.write_str("STBPower"),
949            Subtitle => f.write_str("Subtitle"),
950            Teletext => f.write_str("Teletext"),
951            VideoModeNext => f.write_str("VideoModeNext"),
952            Wink => f.write_str("Wink"),
953            ZoomToggle => f.write_str("ZoomToggle"),
954            F1 => f.write_str("F1"),
955            F2 => f.write_str("F2"),
956            F3 => f.write_str("F3"),
957            F4 => f.write_str("F4"),
958            F5 => f.write_str("F5"),
959            F6 => f.write_str("F6"),
960            F7 => f.write_str("F7"),
961            F8 => f.write_str("F8"),
962            F9 => f.write_str("F9"),
963            F10 => f.write_str("F10"),
964            F11 => f.write_str("F11"),
965            F12 => f.write_str("F12"),
966            F13 => f.write_str("F13"),
967            F14 => f.write_str("F14"),
968            F15 => f.write_str("F15"),
969            F16 => f.write_str("F16"),
970            F17 => f.write_str("F17"),
971            F18 => f.write_str("F18"),
972            F19 => f.write_str("F19"),
973            F20 => f.write_str("F20"),
974            F21 => f.write_str("F21"),
975            F22 => f.write_str("F22"),
976            F23 => f.write_str("F23"),
977            F24 => f.write_str("F24"),
978            F25 => f.write_str("F25"),
979            F26 => f.write_str("F26"),
980            F27 => f.write_str("F27"),
981            F28 => f.write_str("F28"),
982            F29 => f.write_str("F29"),
983            F30 => f.write_str("F30"),
984            F31 => f.write_str("F31"),
985            F32 => f.write_str("F32"),
986            F33 => f.write_str("F33"),
987            F34 => f.write_str("F34"),
988            F35 => f.write_str("F35"),
989
990        }
991    }
992}
993
994impl FromStr for NamedKey {
995    type Err = UnrecognizedNamedKeyError;
996
997    fn from_str(s: &str) -> Result<Self, Self::Err> {
998        use crate::NamedKey::*;
999        match s {
1000            "Unidentified" => Ok(Unidentified),
1001            "Alt" => Ok(Alt),
1002            "AltGraph" => Ok(AltGraph),
1003            "CapsLock" => Ok(CapsLock),
1004            "Control" => Ok(Control),
1005            "Fn" => Ok(Fn),
1006            "FnLock" => Ok(FnLock),
1007            "Meta" => Ok(Meta),
1008            "NumLock" => Ok(NumLock),
1009            "ScrollLock" => Ok(ScrollLock),
1010            "Shift" => Ok(Shift),
1011            "Symbol" => Ok(Symbol),
1012            "SymbolLock" => Ok(SymbolLock),
1013            "Hyper" => Ok(Hyper),
1014            "Super" => Ok(Super),
1015            "Enter" => Ok(Enter),
1016            "Tab" => Ok(Tab),
1017            "ArrowDown" => Ok(ArrowDown),
1018            "ArrowLeft" => Ok(ArrowLeft),
1019            "ArrowRight" => Ok(ArrowRight),
1020            "ArrowUp" => Ok(ArrowUp),
1021            "End" => Ok(End),
1022            "Home" => Ok(Home),
1023            "PageDown" => Ok(PageDown),
1024            "PageUp" => Ok(PageUp),
1025            "Backspace" => Ok(Backspace),
1026            "Clear" => Ok(Clear),
1027            "Copy" => Ok(Copy),
1028            "CrSel" => Ok(CrSel),
1029            "Cut" => Ok(Cut),
1030            "Delete" => Ok(Delete),
1031            "EraseEof" => Ok(EraseEof),
1032            "ExSel" => Ok(ExSel),
1033            "Insert" => Ok(Insert),
1034            "Paste" => Ok(Paste),
1035            "Redo" => Ok(Redo),
1036            "Undo" => Ok(Undo),
1037            "Accept" => Ok(Accept),
1038            "Again" => Ok(Again),
1039            "Attn" => Ok(Attn),
1040            "Cancel" => Ok(Cancel),
1041            "ContextMenu" => Ok(ContextMenu),
1042            "Escape" => Ok(Escape),
1043            "Execute" => Ok(Execute),
1044            "Find" => Ok(Find),
1045            "Help" => Ok(Help),
1046            "Pause" => Ok(Pause),
1047            "Play" => Ok(Play),
1048            "Props" => Ok(Props),
1049            "Select" => Ok(Select),
1050            "ZoomIn" => Ok(ZoomIn),
1051            "ZoomOut" => Ok(ZoomOut),
1052            "BrightnessDown" => Ok(BrightnessDown),
1053            "BrightnessUp" => Ok(BrightnessUp),
1054            "Eject" => Ok(Eject),
1055            "LogOff" => Ok(LogOff),
1056            "Power" => Ok(Power),
1057            "PowerOff" => Ok(PowerOff),
1058            "PrintScreen" => Ok(PrintScreen),
1059            "Hibernate" => Ok(Hibernate),
1060            "Standby" => Ok(Standby),
1061            "WakeUp" => Ok(WakeUp),
1062            "AllCandidates" => Ok(AllCandidates),
1063            "Alphanumeric" => Ok(Alphanumeric),
1064            "CodeInput" => Ok(CodeInput),
1065            "Compose" => Ok(Compose),
1066            "Convert" => Ok(Convert),
1067            "Dead" => Ok(Dead),
1068            "FinalMode" => Ok(FinalMode),
1069            "GroupFirst" => Ok(GroupFirst),
1070            "GroupLast" => Ok(GroupLast),
1071            "GroupNext" => Ok(GroupNext),
1072            "GroupPrevious" => Ok(GroupPrevious),
1073            "ModeChange" => Ok(ModeChange),
1074            "NextCandidate" => Ok(NextCandidate),
1075            "NonConvert" => Ok(NonConvert),
1076            "PreviousCandidate" => Ok(PreviousCandidate),
1077            "Process" => Ok(Process),
1078            "SingleCandidate" => Ok(SingleCandidate),
1079            "HangulMode" => Ok(HangulMode),
1080            "HanjaMode" => Ok(HanjaMode),
1081            "JunjaMode" => Ok(JunjaMode),
1082            "Eisu" => Ok(Eisu),
1083            "Hankaku" => Ok(Hankaku),
1084            "Hiragana" => Ok(Hiragana),
1085            "HiraganaKatakana" => Ok(HiraganaKatakana),
1086            "KanaMode" => Ok(KanaMode),
1087            "KanjiMode" => Ok(KanjiMode),
1088            "Katakana" => Ok(Katakana),
1089            "Romaji" => Ok(Romaji),
1090            "Zenkaku" => Ok(Zenkaku),
1091            "ZenkakuHankaku" => Ok(ZenkakuHankaku),
1092            "Soft1" => Ok(Soft1),
1093            "Soft2" => Ok(Soft2),
1094            "Soft3" => Ok(Soft3),
1095            "Soft4" => Ok(Soft4),
1096            "ChannelDown" => Ok(ChannelDown),
1097            "ChannelUp" => Ok(ChannelUp),
1098            "Close" => Ok(Close),
1099            "MailForward" => Ok(MailForward),
1100            "MailReply" => Ok(MailReply),
1101            "MailSend" => Ok(MailSend),
1102            "MediaClose" => Ok(MediaClose),
1103            "MediaFastForward" => Ok(MediaFastForward),
1104            "MediaPause" => Ok(MediaPause),
1105            "MediaPlay" => Ok(MediaPlay),
1106            "MediaPlayPause" => Ok(MediaPlayPause),
1107            "MediaRecord" => Ok(MediaRecord),
1108            "MediaRewind" => Ok(MediaRewind),
1109            "MediaStop" => Ok(MediaStop),
1110            "MediaTrackNext" => Ok(MediaTrackNext),
1111            "MediaTrackPrevious" => Ok(MediaTrackPrevious),
1112            "New" => Ok(New),
1113            "Open" => Ok(Open),
1114            "Print" => Ok(Print),
1115            "Save" => Ok(Save),
1116            "SpellCheck" => Ok(SpellCheck),
1117            "Key11" => Ok(Key11),
1118            "Key12" => Ok(Key12),
1119            "AudioBalanceLeft" => Ok(AudioBalanceLeft),
1120            "AudioBalanceRight" => Ok(AudioBalanceRight),
1121            "AudioBassBoostDown" => Ok(AudioBassBoostDown),
1122            "AudioBassBoostToggle" => Ok(AudioBassBoostToggle),
1123            "AudioBassBoostUp" => Ok(AudioBassBoostUp),
1124            "AudioFaderFront" => Ok(AudioFaderFront),
1125            "AudioFaderRear" => Ok(AudioFaderRear),
1126            "AudioSurroundModeNext" => Ok(AudioSurroundModeNext),
1127            "AudioTrebleDown" => Ok(AudioTrebleDown),
1128            "AudioTrebleUp" => Ok(AudioTrebleUp),
1129            "AudioVolumeDown" => Ok(AudioVolumeDown),
1130            "AudioVolumeUp" => Ok(AudioVolumeUp),
1131            "AudioVolumeMute" => Ok(AudioVolumeMute),
1132            "MicrophoneToggle" => Ok(MicrophoneToggle),
1133            "MicrophoneVolumeDown" => Ok(MicrophoneVolumeDown),
1134            "MicrophoneVolumeUp" => Ok(MicrophoneVolumeUp),
1135            "MicrophoneVolumeMute" => Ok(MicrophoneVolumeMute),
1136            "SpeechCorrectionList" => Ok(SpeechCorrectionList),
1137            "SpeechInputToggle" => Ok(SpeechInputToggle),
1138            "LaunchApplication1" => Ok(LaunchApplication1),
1139            "LaunchApplication2" => Ok(LaunchApplication2),
1140            "LaunchCalendar" => Ok(LaunchCalendar),
1141            "LaunchContacts" => Ok(LaunchContacts),
1142            "LaunchMail" => Ok(LaunchMail),
1143            "LaunchMediaPlayer" => Ok(LaunchMediaPlayer),
1144            "LaunchMusicPlayer" => Ok(LaunchMusicPlayer),
1145            "LaunchPhone" => Ok(LaunchPhone),
1146            "LaunchScreenSaver" => Ok(LaunchScreenSaver),
1147            "LaunchSpreadsheet" => Ok(LaunchSpreadsheet),
1148            "LaunchWebBrowser" => Ok(LaunchWebBrowser),
1149            "LaunchWebCam" => Ok(LaunchWebCam),
1150            "LaunchWordProcessor" => Ok(LaunchWordProcessor),
1151            "BrowserBack" => Ok(BrowserBack),
1152            "BrowserFavorites" => Ok(BrowserFavorites),
1153            "BrowserForward" => Ok(BrowserForward),
1154            "BrowserHome" => Ok(BrowserHome),
1155            "BrowserRefresh" => Ok(BrowserRefresh),
1156            "BrowserSearch" => Ok(BrowserSearch),
1157            "BrowserStop" => Ok(BrowserStop),
1158            "AppSwitch" => Ok(AppSwitch),
1159            "Call" => Ok(Call),
1160            "Camera" => Ok(Camera),
1161            "CameraFocus" => Ok(CameraFocus),
1162            "EndCall" => Ok(EndCall),
1163            "GoBack" => Ok(GoBack),
1164            "GoHome" => Ok(GoHome),
1165            "HeadsetHook" => Ok(HeadsetHook),
1166            "LastNumberRedial" => Ok(LastNumberRedial),
1167            "Notification" => Ok(Notification),
1168            "MannerMode" => Ok(MannerMode),
1169            "VoiceDial" => Ok(VoiceDial),
1170            "TV" => Ok(TV),
1171            "TV3DMode" => Ok(TV3DMode),
1172            "TVAntennaCable" => Ok(TVAntennaCable),
1173            "TVAudioDescription" => Ok(TVAudioDescription),
1174            "TVAudioDescriptionMixDown" => Ok(TVAudioDescriptionMixDown),
1175            "TVAudioDescriptionMixUp" => Ok(TVAudioDescriptionMixUp),
1176            "TVContentsMenu" => Ok(TVContentsMenu),
1177            "TVDataService" => Ok(TVDataService),
1178            "TVInput" => Ok(TVInput),
1179            "TVInputComponent1" => Ok(TVInputComponent1),
1180            "TVInputComponent2" => Ok(TVInputComponent2),
1181            "TVInputComposite1" => Ok(TVInputComposite1),
1182            "TVInputComposite2" => Ok(TVInputComposite2),
1183            "TVInputHDMI1" => Ok(TVInputHDMI1),
1184            "TVInputHDMI2" => Ok(TVInputHDMI2),
1185            "TVInputHDMI3" => Ok(TVInputHDMI3),
1186            "TVInputHDMI4" => Ok(TVInputHDMI4),
1187            "TVInputVGA1" => Ok(TVInputVGA1),
1188            "TVMediaContext" => Ok(TVMediaContext),
1189            "TVNetwork" => Ok(TVNetwork),
1190            "TVNumberEntry" => Ok(TVNumberEntry),
1191            "TVPower" => Ok(TVPower),
1192            "TVRadioService" => Ok(TVRadioService),
1193            "TVSatellite" => Ok(TVSatellite),
1194            "TVSatelliteBS" => Ok(TVSatelliteBS),
1195            "TVSatelliteCS" => Ok(TVSatelliteCS),
1196            "TVSatelliteToggle" => Ok(TVSatelliteToggle),
1197            "TVTerrestrialAnalog" => Ok(TVTerrestrialAnalog),
1198            "TVTerrestrialDigital" => Ok(TVTerrestrialDigital),
1199            "TVTimer" => Ok(TVTimer),
1200            "AVRInput" => Ok(AVRInput),
1201            "AVRPower" => Ok(AVRPower),
1202            "ColorF0Red" => Ok(ColorF0Red),
1203            "ColorF1Green" => Ok(ColorF1Green),
1204            "ColorF2Yellow" => Ok(ColorF2Yellow),
1205            "ColorF3Blue" => Ok(ColorF3Blue),
1206            "ColorF4Grey" => Ok(ColorF4Grey),
1207            "ColorF5Brown" => Ok(ColorF5Brown),
1208            "ClosedCaptionToggle" => Ok(ClosedCaptionToggle),
1209            "Dimmer" => Ok(Dimmer),
1210            "DisplaySwap" => Ok(DisplaySwap),
1211            "DVR" => Ok(DVR),
1212            "Exit" => Ok(Exit),
1213            "FavoriteClear0" => Ok(FavoriteClear0),
1214            "FavoriteClear1" => Ok(FavoriteClear1),
1215            "FavoriteClear2" => Ok(FavoriteClear2),
1216            "FavoriteClear3" => Ok(FavoriteClear3),
1217            "FavoriteRecall0" => Ok(FavoriteRecall0),
1218            "FavoriteRecall1" => Ok(FavoriteRecall1),
1219            "FavoriteRecall2" => Ok(FavoriteRecall2),
1220            "FavoriteRecall3" => Ok(FavoriteRecall3),
1221            "FavoriteStore0" => Ok(FavoriteStore0),
1222            "FavoriteStore1" => Ok(FavoriteStore1),
1223            "FavoriteStore2" => Ok(FavoriteStore2),
1224            "FavoriteStore3" => Ok(FavoriteStore3),
1225            "Guide" => Ok(Guide),
1226            "GuideNextDay" => Ok(GuideNextDay),
1227            "GuidePreviousDay" => Ok(GuidePreviousDay),
1228            "Info" => Ok(Info),
1229            "InstantReplay" => Ok(InstantReplay),
1230            "Link" => Ok(Link),
1231            "ListProgram" => Ok(ListProgram),
1232            "LiveContent" => Ok(LiveContent),
1233            "Lock" => Ok(Lock),
1234            "MediaApps" => Ok(MediaApps),
1235            "MediaAudioTrack" => Ok(MediaAudioTrack),
1236            "MediaLast" => Ok(MediaLast),
1237            "MediaSkipBackward" => Ok(MediaSkipBackward),
1238            "MediaSkipForward" => Ok(MediaSkipForward),
1239            "MediaStepBackward" => Ok(MediaStepBackward),
1240            "MediaStepForward" => Ok(MediaStepForward),
1241            "MediaTopMenu" => Ok(MediaTopMenu),
1242            "NavigateIn" => Ok(NavigateIn),
1243            "NavigateNext" => Ok(NavigateNext),
1244            "NavigateOut" => Ok(NavigateOut),
1245            "NavigatePrevious" => Ok(NavigatePrevious),
1246            "NextFavoriteChannel" => Ok(NextFavoriteChannel),
1247            "NextUserProfile" => Ok(NextUserProfile),
1248            "OnDemand" => Ok(OnDemand),
1249            "Pairing" => Ok(Pairing),
1250            "PinPDown" => Ok(PinPDown),
1251            "PinPMove" => Ok(PinPMove),
1252            "PinPToggle" => Ok(PinPToggle),
1253            "PinPUp" => Ok(PinPUp),
1254            "PlaySpeedDown" => Ok(PlaySpeedDown),
1255            "PlaySpeedReset" => Ok(PlaySpeedReset),
1256            "PlaySpeedUp" => Ok(PlaySpeedUp),
1257            "RandomToggle" => Ok(RandomToggle),
1258            "RcLowBattery" => Ok(RcLowBattery),
1259            "RecordSpeedNext" => Ok(RecordSpeedNext),
1260            "RfBypass" => Ok(RfBypass),
1261            "ScanChannelsToggle" => Ok(ScanChannelsToggle),
1262            "ScreenModeNext" => Ok(ScreenModeNext),
1263            "Settings" => Ok(Settings),
1264            "SplitScreenToggle" => Ok(SplitScreenToggle),
1265            "STBInput" => Ok(STBInput),
1266            "STBPower" => Ok(STBPower),
1267            "Subtitle" => Ok(Subtitle),
1268            "Teletext" => Ok(Teletext),
1269            "VideoModeNext" => Ok(VideoModeNext),
1270            "Wink" => Ok(Wink),
1271            "ZoomToggle" => Ok(ZoomToggle),
1272            "F1" => Ok(F1),
1273            "F2" => Ok(F2),
1274            "F3" => Ok(F3),
1275            "F4" => Ok(F4),
1276            "F5" => Ok(F5),
1277            "F6" => Ok(F6),
1278            "F7" => Ok(F7),
1279            "F8" => Ok(F8),
1280            "F9" => Ok(F9),
1281            "F10" => Ok(F10),
1282            "F11" => Ok(F11),
1283            "F12" => Ok(F12),
1284            "F13" => Ok(F13),
1285            "F14" => Ok(F14),
1286            "F15" => Ok(F15),
1287            "F16" => Ok(F16),
1288            "F17" => Ok(F17),
1289            "F18" => Ok(F18),
1290            "F19" => Ok(F19),
1291            "F20" => Ok(F20),
1292            "F21" => Ok(F21),
1293            "F22" => Ok(F22),
1294            "F23" => Ok(F23),
1295            "F24" => Ok(F24),
1296            "F25" => Ok(F25),
1297            "F26" => Ok(F26),
1298            "F27" => Ok(F27),
1299            "F28" => Ok(F28),
1300            "F29" => Ok(F29),
1301            "F30" => Ok(F30),
1302            "F31" => Ok(F31),
1303            "F32" => Ok(F32),
1304            "F33" => Ok(F33),
1305            "F34" => Ok(F34),
1306            "F35" => Ok(F35),
1307
1308            _ => Err(UnrecognizedNamedKeyError),
1309        }
1310    }
1311}
1312
1313/// Parse from string error, returned when string does not match to any [`NamedKey`] variant.
1314#[derive(Clone, Debug)]
1315pub struct UnrecognizedNamedKeyError;
1316
1317impl fmt::Display for UnrecognizedNamedKeyError {
1318    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1319        write!(f, "Unrecognized key")
1320    }
1321}
1322
1323impl Error for UnrecognizedNamedKeyError {}