vizia_winit/
convert.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
use vizia_core::prelude::CursorIcon as ViziaCursorIcon;
use vizia_input::Code as ViziaCode;
use vizia_input::Key as ViziaKey;
use winit::keyboard::KeyCode;
use winit::keyboard::NamedKey;
use winit::window::CursorIcon as WinitCursorIcon;

pub fn cursor_icon_to_cursor_icon(cursor_icon: ViziaCursorIcon) -> Option<WinitCursorIcon> {
    match cursor_icon {
        ViziaCursorIcon::Default => Some(WinitCursorIcon::Default),
        ViziaCursorIcon::Crosshair => Some(WinitCursorIcon::Crosshair),
        ViziaCursorIcon::Hand => Some(WinitCursorIcon::Pointer),
        ViziaCursorIcon::Arrow => Some(WinitCursorIcon::Default),
        ViziaCursorIcon::Move => Some(WinitCursorIcon::Move),
        ViziaCursorIcon::Text => Some(WinitCursorIcon::Text),
        ViziaCursorIcon::Wait => Some(WinitCursorIcon::Wait),
        ViziaCursorIcon::Help => Some(WinitCursorIcon::Help),
        ViziaCursorIcon::Progress => Some(WinitCursorIcon::Progress),
        ViziaCursorIcon::NotAllowed => Some(WinitCursorIcon::NotAllowed),
        ViziaCursorIcon::ContextMenu => Some(WinitCursorIcon::ContextMenu),
        ViziaCursorIcon::Cell => Some(WinitCursorIcon::Cell),
        ViziaCursorIcon::VerticalText => Some(WinitCursorIcon::VerticalText),
        ViziaCursorIcon::Alias => Some(WinitCursorIcon::Alias),
        ViziaCursorIcon::Copy => Some(WinitCursorIcon::Copy),
        ViziaCursorIcon::NoDrop => Some(WinitCursorIcon::NoDrop),
        ViziaCursorIcon::Grab => Some(WinitCursorIcon::Grab),
        ViziaCursorIcon::Grabbing => Some(WinitCursorIcon::Grabbing),
        ViziaCursorIcon::AllScroll => Some(WinitCursorIcon::AllScroll),
        ViziaCursorIcon::ZoomIn => Some(WinitCursorIcon::ZoomIn),
        ViziaCursorIcon::ZoomOut => Some(WinitCursorIcon::ZoomOut),
        ViziaCursorIcon::EResize => Some(WinitCursorIcon::EResize),
        ViziaCursorIcon::NResize => Some(WinitCursorIcon::NResize),
        ViziaCursorIcon::NeResize => Some(WinitCursorIcon::NeResize),
        ViziaCursorIcon::NwResize => Some(WinitCursorIcon::NwResize),
        ViziaCursorIcon::SResize => Some(WinitCursorIcon::SResize),
        ViziaCursorIcon::SeResize => Some(WinitCursorIcon::SeResize),
        ViziaCursorIcon::SwResize => Some(WinitCursorIcon::SwResize),
        ViziaCursorIcon::WResize => Some(WinitCursorIcon::WResize),
        ViziaCursorIcon::EwResize => Some(WinitCursorIcon::EwResize),
        ViziaCursorIcon::NsResize => Some(WinitCursorIcon::NsResize),
        ViziaCursorIcon::NeswResize => Some(WinitCursorIcon::NeswResize),
        ViziaCursorIcon::NwseResize => Some(WinitCursorIcon::NwseResize),
        ViziaCursorIcon::ColResize => Some(WinitCursorIcon::ColResize),
        ViziaCursorIcon::RowResize => Some(WinitCursorIcon::RowResize),
        ViziaCursorIcon::None => None,
    }
}

pub fn winit_key_code_to_code(virtual_key_code: KeyCode) -> ViziaCode {
    use winit::keyboard::KeyCode::*;
    match virtual_key_code {
        Digit1 => ViziaCode::Digit1,
        Digit2 => ViziaCode::Digit2,
        Digit3 => ViziaCode::Digit3,
        Digit4 => ViziaCode::Digit4,
        Digit5 => ViziaCode::Digit5,
        Digit6 => ViziaCode::Digit6,
        Digit7 => ViziaCode::Digit7,
        Digit8 => ViziaCode::Digit8,
        Digit9 => ViziaCode::Digit9,
        Digit0 => ViziaCode::Digit0,
        KeyA => ViziaCode::KeyA,
        KeyB => ViziaCode::KeyB,
        KeyC => ViziaCode::KeyC,
        KeyD => ViziaCode::KeyD,
        KeyE => ViziaCode::KeyE,
        KeyF => ViziaCode::KeyF,
        KeyG => ViziaCode::KeyG,
        KeyH => ViziaCode::KeyH,
        KeyI => ViziaCode::KeyI,
        KeyJ => ViziaCode::KeyJ,
        KeyK => ViziaCode::KeyK,
        KeyL => ViziaCode::KeyL,
        KeyM => ViziaCode::KeyM,
        KeyN => ViziaCode::KeyN,
        KeyO => ViziaCode::KeyO,
        KeyP => ViziaCode::KeyP,
        KeyQ => ViziaCode::KeyQ,
        KeyR => ViziaCode::KeyR,
        KeyS => ViziaCode::KeyS,
        KeyT => ViziaCode::KeyT,
        KeyU => ViziaCode::KeyU,
        KeyV => ViziaCode::KeyV,
        KeyW => ViziaCode::KeyW,
        KeyX => ViziaCode::KeyX,
        KeyY => ViziaCode::KeyY,
        KeyZ => ViziaCode::KeyZ,
        Escape => ViziaCode::Escape,
        F1 => ViziaCode::F1,
        F2 => ViziaCode::F2,
        F3 => ViziaCode::F3,
        F4 => ViziaCode::F4,
        F5 => ViziaCode::F5,
        F6 => ViziaCode::F6,
        F7 => ViziaCode::F7,
        F8 => ViziaCode::F8,
        F9 => ViziaCode::F9,
        F10 => ViziaCode::F10,
        F11 => ViziaCode::F11,
        F12 => ViziaCode::F12,
        Insert => ViziaCode::Insert,
        Home => ViziaCode::Home,
        Delete => ViziaCode::Delete,
        End => ViziaCode::End,
        PageDown => ViziaCode::PageDown,
        PageUp => ViziaCode::PageUp,
        ArrowLeft => ViziaCode::ArrowLeft,
        ArrowUp => ViziaCode::ArrowUp,
        ArrowRight => ViziaCode::ArrowRight,
        ArrowDown => ViziaCode::ArrowDown,
        Backspace => ViziaCode::Backspace,
        Enter => ViziaCode::Enter,
        Space => ViziaCode::Space,
        Numpad0 => ViziaCode::Numpad0,
        Numpad1 => ViziaCode::Numpad1,
        Numpad2 => ViziaCode::Numpad2,
        Numpad3 => ViziaCode::Numpad3,
        Numpad4 => ViziaCode::Numpad4,
        Numpad5 => ViziaCode::Numpad5,
        Numpad6 => ViziaCode::Numpad6,
        Numpad7 => ViziaCode::Numpad7,
        Numpad8 => ViziaCode::Numpad8,
        Numpad9 => ViziaCode::Numpad9,
        NumpadAdd => ViziaCode::NumpadAdd,
        NumpadDivide => ViziaCode::NumpadDivide,
        NumpadDecimal => ViziaCode::NumpadDecimal,
        NumpadComma => ViziaCode::NumpadComma,
        NumpadEnter => ViziaCode::NumpadEnter,
        NumpadEqual => ViziaCode::NumpadEqual,
        NumpadMultiply => ViziaCode::NumpadMultiply,
        NumpadSubtract => ViziaCode::NumpadSubtract,
        Comma => ViziaCode::Comma,
        Equal => ViziaCode::Equal,
        Backquote => ViziaCode::Backquote,
        AltLeft => ViziaCode::AltLeft,
        BracketLeft => ViziaCode::BracketLeft,
        ControlLeft => ViziaCode::ControlLeft,
        ShiftLeft => ViziaCode::ShiftLeft,
        Minus => ViziaCode::Minus,
        Period => ViziaCode::Period,
        Semicolon => ViziaCode::Semicolon,
        Slash => ViziaCode::Slash,
        Tab => ViziaCode::Tab,
        _ => ViziaCode::NonConvert,
    }
}

pub fn _scan_code_to_code(scan_code: u32) -> ViziaCode {
    match scan_code {
        0x001 => ViziaCode::Escape,
        0x002 => ViziaCode::Digit1,
        0x003 => ViziaCode::Digit2,
        0x004 => ViziaCode::Digit3,
        0x005 => ViziaCode::Digit4,
        0x006 => ViziaCode::Digit5,
        0x007 => ViziaCode::Digit6,
        0x008 => ViziaCode::Digit7,
        0x009 => ViziaCode::Digit8,
        0x00A => ViziaCode::Digit9,
        0x00B => ViziaCode::Digit0,
        0x00C => ViziaCode::Minus,
        0x00D => ViziaCode::Equal,
        0x00E => ViziaCode::Backspace,
        0x00F => ViziaCode::Tab,
        0x010 => ViziaCode::KeyQ,
        0x011 => ViziaCode::KeyW,
        0x012 => ViziaCode::KeyE,
        0x013 => ViziaCode::KeyR,
        0x014 => ViziaCode::KeyT,
        0x015 => ViziaCode::KeyY,
        0x016 => ViziaCode::KeyU,
        0x017 => ViziaCode::KeyI,
        0x018 => ViziaCode::KeyO,
        0x019 => ViziaCode::KeyP,
        0x01A => ViziaCode::BracketLeft,
        0x01B => ViziaCode::BracketRight,
        0x01C => ViziaCode::Enter,
        0x01D => ViziaCode::ControlLeft,
        0x01E => ViziaCode::KeyA,
        0x01F => ViziaCode::KeyS,
        0x020 => ViziaCode::KeyD,
        0x021 => ViziaCode::KeyF,
        0x022 => ViziaCode::KeyG,
        0x023 => ViziaCode::KeyH,
        0x024 => ViziaCode::KeyJ,
        0x025 => ViziaCode::KeyK,
        0x026 => ViziaCode::KeyL,
        0x027 => ViziaCode::Semicolon,
        0x028 => ViziaCode::Quote,
        0x029 => ViziaCode::Backquote,
        0x02A => ViziaCode::ShiftLeft,
        0x02B => ViziaCode::Backslash,
        0x02C => ViziaCode::KeyZ,
        0x02D => ViziaCode::KeyX,
        0x02E => ViziaCode::KeyC,
        0x02F => ViziaCode::KeyV,
        0x030 => ViziaCode::KeyB,
        0x031 => ViziaCode::KeyN,
        0x032 => ViziaCode::KeyM,
        0x033 => ViziaCode::Comma,
        0x034 => ViziaCode::Period,
        0x035 => ViziaCode::Slash,
        0x036 => ViziaCode::ShiftRight,
        0x037 => ViziaCode::NumpadMultiply,
        0x038 => ViziaCode::AltLeft,
        0x039 => ViziaCode::Space,
        0x03A => ViziaCode::CapsLock,
        0x03B => ViziaCode::F1,
        0x03C => ViziaCode::F2,
        0x03D => ViziaCode::F3,
        0x03E => ViziaCode::F4,
        0x03F => ViziaCode::F5,
        0x040 => ViziaCode::F6,
        0x041 => ViziaCode::F7,
        0x042 => ViziaCode::F8,
        0x043 => ViziaCode::F9,
        0x044 => ViziaCode::F10,
        0x045 => ViziaCode::Pause,
        0x046 => ViziaCode::ScrollLock,
        0x047 => ViziaCode::Numpad7,
        0x048 => ViziaCode::Numpad8,
        0x049 => ViziaCode::Numpad9,
        0x04A => ViziaCode::NumpadSubtract,
        0x04B => ViziaCode::Numpad4,
        0x04C => ViziaCode::Numpad5,
        0x04D => ViziaCode::Numpad6,
        0x04E => ViziaCode::NumpadAdd,
        0x04F => ViziaCode::Numpad1,
        0x050 => ViziaCode::Numpad2,
        0x051 => ViziaCode::Numpad3,
        0x052 => ViziaCode::Numpad0,
        0x053 => ViziaCode::NumpadDecimal,
        0x054 => ViziaCode::PrintScreen,
        0x056 => ViziaCode::IntlBackslash,
        0x057 => ViziaCode::F11,
        0x058 => ViziaCode::F12,
        0x059 => ViziaCode::NumpadEqual,
        0x070 => ViziaCode::KanaMode,
        0x071 => ViziaCode::Lang2,
        0x072 => ViziaCode::Lang1,
        0x073 => ViziaCode::IntlRo,
        0x079 => ViziaCode::Convert,
        0x07B => ViziaCode::NonConvert,
        0x07D => ViziaCode::IntlYen,
        0x07E => ViziaCode::NumpadComma,
        0x110 => ViziaCode::MediaTrackPrevious,
        0x119 => ViziaCode::MediaTrackNext,
        0x11C => ViziaCode::NumpadEnter,
        0x11D => ViziaCode::ControlRight,
        0x120 => ViziaCode::AudioVolumeMute,
        0x121 => ViziaCode::LaunchApp2,
        0x122 => ViziaCode::MediaPlayPause,
        0x124 => ViziaCode::MediaStop,
        0x12E => ViziaCode::AudioVolumeDown,
        0x130 => ViziaCode::AudioVolumeUp,
        0x132 => ViziaCode::BrowserHome,
        0x135 => ViziaCode::NumpadDivide,
        0x137 => ViziaCode::PrintScreen,
        0x138 => ViziaCode::AltRight,
        0x145 => ViziaCode::NumLock,
        0x147 => ViziaCode::Home,
        0x148 => ViziaCode::ArrowUp,
        0x149 => ViziaCode::PageUp,
        0x14B => ViziaCode::ArrowLeft,
        0x14D => ViziaCode::ArrowRight,
        0x14F => ViziaCode::End,
        0x150 => ViziaCode::ArrowDown,
        0x151 => ViziaCode::PageDown,
        0x152 => ViziaCode::Insert,
        0x153 => ViziaCode::Delete,
        0x15B => ViziaCode::MetaLeft,
        0x15C => ViziaCode::MetaRight,
        0x15D => ViziaCode::ContextMenu,
        0x15E => ViziaCode::Power,
        0x165 => ViziaCode::BrowserSearch,
        0x166 => ViziaCode::BrowserFavorites,
        0x167 => ViziaCode::BrowserRefresh,
        0x168 => ViziaCode::BrowserStop,
        0x169 => ViziaCode::BrowserForward,
        0x16A => ViziaCode::BrowserBack,
        0x16B => ViziaCode::LaunchApp1,
        0x16C => ViziaCode::LaunchMail,
        0x16D => ViziaCode::MediaSelect,
        0x1F1 => ViziaCode::Lang2,
        0x1F2 => ViziaCode::Lang1,
        _ => ViziaCode::Unidentified,
    }
}

pub fn winit_key_to_key(virtual_key_code: NamedKey) -> Option<ViziaKey> {
    use winit::keyboard::NamedKey::*;
    match virtual_key_code {
        Backspace => Some(ViziaKey::Backspace),
        Tab => Some(ViziaKey::Tab),
        Enter => Some(ViziaKey::Enter),
        Shift => Some(ViziaKey::Shift),
        Control => Some(ViziaKey::Control),
        Alt => Some(ViziaKey::Alt),
        Pause => Some(ViziaKey::Pause),
        CapsLock => Some(ViziaKey::CapsLock),
        // TODO: disambiguate kana and hangul? same vk
        KanaMode => Some(ViziaKey::KanaMode),
        KanjiMode => Some(ViziaKey::KanjiMode),
        Escape => Some(ViziaKey::Escape),
        PageUp => Some(ViziaKey::PageUp),
        PageDown => Some(ViziaKey::PageDown),
        End => Some(ViziaKey::End),
        Home => Some(ViziaKey::Home),
        ArrowLeft => Some(ViziaKey::ArrowLeft),
        ArrowUp => Some(ViziaKey::ArrowUp),
        ArrowRight => Some(ViziaKey::ArrowRight),
        ArrowDown => Some(ViziaKey::ArrowDown),
        Select => Some(ViziaKey::Select),
        Print => Some(ViziaKey::Print),
        Insert => Some(ViziaKey::Insert),
        Delete => Some(ViziaKey::Delete),
        Meta => Some(ViziaKey::Meta),
        ContextMenu => Some(ViziaKey::ContextMenu),
        Standby => Some(ViziaKey::Standby),
        F1 => Some(ViziaKey::F1),
        F2 => Some(ViziaKey::F2),
        F3 => Some(ViziaKey::F3),
        F4 => Some(ViziaKey::F4),
        F5 => Some(ViziaKey::F5),
        F6 => Some(ViziaKey::F6),
        F7 => Some(ViziaKey::F7),
        F8 => Some(ViziaKey::F8),
        F9 => Some(ViziaKey::F9),
        F10 => Some(ViziaKey::F10),
        F11 => Some(ViziaKey::F11),
        F12 => Some(ViziaKey::F12),
        NumLock => Some(ViziaKey::NumLock),
        ScrollLock => Some(ViziaKey::ScrollLock),
        AltGraph => Some(ViziaKey::AltGraph),
        Fn => Some(ViziaKey::Fn),
        FnLock => Some(ViziaKey::FnLock),
        Symbol => Some(ViziaKey::Symbol),
        SymbolLock => Some(ViziaKey::SymbolLock),
        Hyper => Some(ViziaKey::Hyper),
        Super => Some(ViziaKey::Super),
        Space => None,
        Clear => Some(ViziaKey::Clear),
        Copy => Some(ViziaKey::Copy),
        CrSel => Some(ViziaKey::CrSel),
        Cut => Some(ViziaKey::Cut),
        EraseEof => Some(ViziaKey::EraseEof),
        ExSel => Some(ViziaKey::ExSel),
        Paste => Some(ViziaKey::Paste),
        Redo => Some(ViziaKey::Redo),
        Undo => Some(ViziaKey::Undo),
        Accept => Some(ViziaKey::Accept),
        Again => Some(ViziaKey::Again),
        Attn => Some(ViziaKey::Attn),
        Cancel => Some(ViziaKey::Cancel),
        Execute => Some(ViziaKey::Execute),
        Find => Some(ViziaKey::Find),
        Help => Some(ViziaKey::Help),
        Play => Some(ViziaKey::Play),
        Props => Some(ViziaKey::Props),
        ZoomIn => Some(ViziaKey::ZoomIn),
        ZoomOut => Some(ViziaKey::ZoomOut),
        BrightnessDown => Some(ViziaKey::BrightnessDown),
        BrightnessUp => Some(ViziaKey::BrightnessUp),
        Eject => Some(ViziaKey::Eject),
        LogOff => Some(ViziaKey::LogOff),
        Power => Some(ViziaKey::Power),
        PowerOff => Some(ViziaKey::PowerOff),
        PrintScreen => Some(ViziaKey::PrintScreen),
        Hibernate => Some(ViziaKey::Hibernate),
        WakeUp => Some(ViziaKey::WakeUp),
        AllCandidates => Some(ViziaKey::AllCandidates),
        Alphanumeric => Some(ViziaKey::Alphanumeric),
        CodeInput => Some(ViziaKey::CodeInput),
        Compose => Some(ViziaKey::Compose),
        Convert => Some(ViziaKey::Convert),
        FinalMode => Some(ViziaKey::FinalMode),
        GroupFirst => Some(ViziaKey::GroupFirst),
        GroupLast => Some(ViziaKey::GroupLast),
        GroupNext => Some(ViziaKey::GroupNext),
        GroupPrevious => Some(ViziaKey::GroupPrevious),
        ModeChange => Some(ViziaKey::ModeChange),
        NextCandidate => Some(ViziaKey::NextCandidate),
        NonConvert => Some(ViziaKey::NonConvert),
        PreviousCandidate => Some(ViziaKey::PreviousCandidate),
        Process => Some(ViziaKey::Process),
        SingleCandidate => Some(ViziaKey::SingleCandidate),
        HangulMode => Some(ViziaKey::HangulMode),
        HanjaMode => Some(ViziaKey::HanjaMode),
        JunjaMode => Some(ViziaKey::JunjaMode),
        Eisu => Some(ViziaKey::Eisu),
        Hankaku => Some(ViziaKey::Hankaku),
        Hiragana => Some(ViziaKey::Hiragana),
        HiraganaKatakana => Some(ViziaKey::HiraganaKatakana),
        Katakana => Some(ViziaKey::Katakana),
        Romaji => Some(ViziaKey::Romaji),
        Zenkaku => Some(ViziaKey::Zenkaku),
        ZenkakuHankaku => Some(ViziaKey::ZenkakuHankaku),
        Soft1 => Some(ViziaKey::Soft1),
        Soft2 => Some(ViziaKey::Soft2),
        Soft3 => Some(ViziaKey::Soft3),
        Soft4 => Some(ViziaKey::Soft4),
        ChannelDown => Some(ViziaKey::ChannelDown),
        ChannelUp => Some(ViziaKey::ChannelUp),
        Close => Some(ViziaKey::Close),
        MailForward => Some(ViziaKey::MailForward),
        MailReply => Some(ViziaKey::MailReply),
        MailSend => Some(ViziaKey::MailSend),
        MediaClose => Some(ViziaKey::MediaClose),
        MediaFastForward => Some(ViziaKey::MediaFastForward),
        MediaPause => Some(ViziaKey::MediaPause),
        MediaPlay => Some(ViziaKey::MediaPlay),
        MediaPlayPause => Some(ViziaKey::MediaPlayPause),
        MediaRecord => Some(ViziaKey::MediaRecord),
        MediaRewind => Some(ViziaKey::MediaRewind),
        MediaStop => Some(ViziaKey::MediaStop),
        MediaTrackNext => Some(ViziaKey::MediaTrackNext),
        MediaTrackPrevious => Some(ViziaKey::MediaTrackPrevious),
        New => Some(ViziaKey::New),
        Open => Some(ViziaKey::Open),
        Save => Some(ViziaKey::Save),
        SpellCheck => Some(ViziaKey::SpellCheck),
        Key11 => Some(ViziaKey::Key11),
        Key12 => Some(ViziaKey::Key12),
        AudioBalanceLeft => Some(ViziaKey::AudioBalanceLeft),
        AudioBalanceRight => Some(ViziaKey::AudioBalanceRight),
        AudioBassBoostDown => Some(ViziaKey::AudioBassBoostDown),
        AudioBassBoostToggle => Some(ViziaKey::AudioBassBoostToggle),
        AudioBassBoostUp => Some(ViziaKey::AudioBassBoostUp),
        AudioFaderFront => Some(ViziaKey::AudioFaderFront),
        AudioFaderRear => Some(ViziaKey::AudioFaderRear),
        AudioSurroundModeNext => Some(ViziaKey::AudioSurroundModeNext),
        AudioTrebleDown => Some(ViziaKey::AudioTrebleDown),
        AudioTrebleUp => Some(ViziaKey::AudioTrebleUp),
        AudioVolumeDown => Some(ViziaKey::AudioVolumeDown),
        AudioVolumeUp => Some(ViziaKey::AudioVolumeUp),
        AudioVolumeMute => Some(ViziaKey::AudioVolumeMute),
        MicrophoneToggle => Some(ViziaKey::MicrophoneToggle),
        MicrophoneVolumeDown => Some(ViziaKey::MicrophoneVolumeDown),
        MicrophoneVolumeUp => Some(ViziaKey::MicrophoneVolumeUp),
        MicrophoneVolumeMute => Some(ViziaKey::MicrophoneVolumeMute),
        SpeechCorrectionList => Some(ViziaKey::SpeechCorrectionList),
        SpeechInputToggle => Some(ViziaKey::SpeechInputToggle),
        LaunchApplication1 => Some(ViziaKey::LaunchApplication1),
        LaunchApplication2 => Some(ViziaKey::LaunchApplication2),
        LaunchCalendar => Some(ViziaKey::LaunchCalendar),
        LaunchContacts => Some(ViziaKey::LaunchContacts),
        LaunchMail => Some(ViziaKey::LaunchMail),
        LaunchMediaPlayer => Some(ViziaKey::LaunchMediaPlayer),
        LaunchMusicPlayer => Some(ViziaKey::LaunchMusicPlayer),
        LaunchPhone => Some(ViziaKey::LaunchPhone),
        LaunchScreenSaver => Some(ViziaKey::LaunchScreenSaver),
        LaunchSpreadsheet => Some(ViziaKey::LaunchSpreadsheet),
        LaunchWebBrowser => Some(ViziaKey::LaunchWebBrowser),
        LaunchWebCam => Some(ViziaKey::LaunchWebCam),
        LaunchWordProcessor => Some(ViziaKey::LaunchWordProcessor),
        BrowserBack => Some(ViziaKey::BrowserBack),
        BrowserFavorites => Some(ViziaKey::BrowserFavorites),
        BrowserForward => Some(ViziaKey::BrowserForward),
        BrowserHome => Some(ViziaKey::BrowserHome),
        BrowserRefresh => Some(ViziaKey::BrowserRefresh),
        BrowserSearch => Some(ViziaKey::BrowserSearch),
        BrowserStop => Some(ViziaKey::BrowserStop),
        AppSwitch => Some(ViziaKey::AppSwitch),
        Call => Some(ViziaKey::Call),
        Camera => Some(ViziaKey::Camera),
        CameraFocus => Some(ViziaKey::CameraFocus),
        EndCall => Some(ViziaKey::EndCall),
        GoBack => Some(ViziaKey::GoBack),
        GoHome => Some(ViziaKey::GoHome),
        HeadsetHook => Some(ViziaKey::HeadsetHook),
        LastNumberRedial => Some(ViziaKey::LastNumberRedial),
        Notification => Some(ViziaKey::Notification),
        MannerMode => Some(ViziaKey::MannerMode),
        VoiceDial => Some(ViziaKey::VoiceDial),
        TV => Some(ViziaKey::TV),
        TV3DMode => Some(ViziaKey::TV3DMode),
        TVAntennaCable => Some(ViziaKey::TVAntennaCable),
        TVAudioDescription => Some(ViziaKey::TVAudioDescription),
        TVAudioDescriptionMixDown => Some(ViziaKey::TVAudioDescriptionMixDown),
        TVAudioDescriptionMixUp => Some(ViziaKey::TVAudioDescriptionMixUp),
        TVContentsMenu => Some(ViziaKey::TVContentsMenu),
        TVDataService => Some(ViziaKey::TVDataService),
        TVInput => Some(ViziaKey::TVInput),
        TVInputComponent1 => Some(ViziaKey::TVInputComponent1),
        TVInputComponent2 => Some(ViziaKey::TVInputComponent2),
        TVInputComposite1 => Some(ViziaKey::TVInputComposite1),
        TVInputComposite2 => Some(ViziaKey::TVInputComposite2),
        TVInputHDMI1 => Some(ViziaKey::TVInputHDMI1),
        TVInputHDMI2 => Some(ViziaKey::TVInputHDMI2),
        TVInputHDMI3 => Some(ViziaKey::TVInputHDMI3),
        TVInputHDMI4 => Some(ViziaKey::TVInputHDMI4),
        TVInputVGA1 => Some(ViziaKey::TVInputVGA1),
        TVMediaContext => Some(ViziaKey::TVMediaContext),
        TVNetwork => Some(ViziaKey::TVNetwork),
        TVNumberEntry => Some(ViziaKey::TVNumberEntry),
        TVPower => Some(ViziaKey::TVPower),
        TVRadioService => Some(ViziaKey::TVRadioService),
        TVSatellite => Some(ViziaKey::TVSatellite),
        TVSatelliteBS => Some(ViziaKey::TVSatelliteBS),
        TVSatelliteCS => Some(ViziaKey::TVSatelliteCS),
        TVSatelliteToggle => Some(ViziaKey::TVSatelliteToggle),
        TVTerrestrialAnalog => Some(ViziaKey::TVTerrestrialAnalog),
        TVTerrestrialDigital => Some(ViziaKey::TVTerrestrialDigital),
        TVTimer => Some(ViziaKey::TVTimer),
        AVRInput => Some(ViziaKey::AVRInput),
        AVRPower => Some(ViziaKey::AVRPower),
        ColorF0Red => Some(ViziaKey::ColorF0Red),
        ColorF1Green => Some(ViziaKey::ColorF1Green),
        ColorF2Yellow => Some(ViziaKey::ColorF2Yellow),
        ColorF3Blue => Some(ViziaKey::ColorF3Blue),
        ColorF4Grey => Some(ViziaKey::ColorF4Grey),
        ColorF5Brown => Some(ViziaKey::ColorF5Brown),
        ClosedCaptionToggle => Some(ViziaKey::ClosedCaptionToggle),
        Dimmer => Some(ViziaKey::Dimmer),
        DisplaySwap => Some(ViziaKey::DisplaySwap),
        DVR => Some(ViziaKey::DVR),
        Exit => Some(ViziaKey::Exit),
        FavoriteClear0 => Some(ViziaKey::FavoriteClear0),
        FavoriteClear1 => Some(ViziaKey::FavoriteClear1),
        FavoriteClear2 => Some(ViziaKey::FavoriteClear2),
        FavoriteClear3 => Some(ViziaKey::FavoriteClear3),
        FavoriteRecall0 => Some(ViziaKey::FavoriteRecall0),
        FavoriteRecall1 => Some(ViziaKey::FavoriteRecall1),
        FavoriteRecall2 => Some(ViziaKey::FavoriteRecall2),
        FavoriteRecall3 => Some(ViziaKey::FavoriteRecall3),
        FavoriteStore0 => Some(ViziaKey::FavoriteStore0),
        FavoriteStore1 => Some(ViziaKey::FavoriteStore1),
        FavoriteStore2 => Some(ViziaKey::FavoriteStore2),
        FavoriteStore3 => Some(ViziaKey::FavoriteStore3),
        Guide => Some(ViziaKey::Guide),
        GuideNextDay => Some(ViziaKey::GuideNextDay),
        GuidePreviousDay => Some(ViziaKey::GuidePreviousDay),
        Info => Some(ViziaKey::Info),
        InstantReplay => Some(ViziaKey::InstantReplay),
        Link => Some(ViziaKey::Link),
        ListProgram => Some(ViziaKey::ListProgram),
        LiveContent => Some(ViziaKey::LiveContent),
        Lock => Some(ViziaKey::Lock),
        MediaApps => Some(ViziaKey::MediaApps),
        MediaAudioTrack => Some(ViziaKey::MediaAudioTrack),
        MediaLast => Some(ViziaKey::MediaLast),
        MediaSkipBackward => Some(ViziaKey::MediaSkipBackward),
        MediaSkipForward => Some(ViziaKey::MediaSkipForward),
        MediaStepBackward => Some(ViziaKey::MediaStepBackward),
        MediaStepForward => Some(ViziaKey::MediaStepForward),
        MediaTopMenu => Some(ViziaKey::MediaTopMenu),
        NavigateIn => Some(ViziaKey::NavigateIn),
        NavigateNext => Some(ViziaKey::NavigateNext),
        NavigateOut => Some(ViziaKey::NavigateOut),
        NavigatePrevious => Some(ViziaKey::NavigatePrevious),
        NextFavoriteChannel => Some(ViziaKey::NextFavoriteChannel),
        NextUserProfile => Some(ViziaKey::NextUserProfile),
        OnDemand => Some(ViziaKey::OnDemand),
        Pairing => Some(ViziaKey::Pairing),
        PinPDown => Some(ViziaKey::PinPDown),
        PinPMove => Some(ViziaKey::PinPMove),
        PinPToggle => Some(ViziaKey::PinPToggle),
        PinPUp => Some(ViziaKey::PinPUp),
        PlaySpeedDown => Some(ViziaKey::PlaySpeedDown),
        PlaySpeedReset => Some(ViziaKey::PlaySpeedReset),
        PlaySpeedUp => Some(ViziaKey::PlaySpeedUp),
        RandomToggle => Some(ViziaKey::RandomToggle),
        RcLowBattery => Some(ViziaKey::RcLowBattery),
        RecordSpeedNext => Some(ViziaKey::RecordSpeedNext),
        RfBypass => Some(ViziaKey::RfBypass),
        ScanChannelsToggle => Some(ViziaKey::ScanChannelsToggle),
        ScreenModeNext => Some(ViziaKey::ScreenModeNext),
        Settings => Some(ViziaKey::Settings),
        SplitScreenToggle => Some(ViziaKey::SplitScreenToggle),
        STBInput => Some(ViziaKey::STBInput),
        STBPower => Some(ViziaKey::STBPower),
        Subtitle => Some(ViziaKey::Subtitle),
        Teletext => Some(ViziaKey::Teletext),
        VideoModeNext => Some(ViziaKey::VideoModeNext),
        Wink => Some(ViziaKey::Wink),
        ZoomToggle => Some(ViziaKey::ZoomToggle),
        F13 => Some(ViziaKey::F13),
        F14 => Some(ViziaKey::F14),
        F15 => Some(ViziaKey::F15),
        F16 => Some(ViziaKey::F16),
        F17 => Some(ViziaKey::F17),
        F18 => Some(ViziaKey::F18),
        F19 => Some(ViziaKey::F19),
        F20 => Some(ViziaKey::F20),
        F21 => Some(ViziaKey::F21),
        F22 => Some(ViziaKey::F22),
        F23 => Some(ViziaKey::F23),
        F24 => Some(ViziaKey::F24),
        F25 => None,
        F26 => None,
        F27 => None,
        F28 => None,
        F29 => None,
        F30 => None,
        F31 => None,
        F32 => None,
        F33 => None,
        F34 => None,
        F35 => None,
        _ => None,
    }
}