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