23 #include <winpr/winpr.h>
24 #include <winpr/wtypes.h>
30 #define KBDEXT 0x0100u
31 #define KBDMULTIVK 0x0200u
32 #define KBDSPECIAL 0x0400u
33 #define KBDNUMPAD 0x0800u
34 #define KBDUNICODE 0x1000u
35 #define KBDINJECTEDVK 0x2000u
36 #define KBDMAPPEDVK 0x4000u
37 #define KBDBREAK 0x8000u
47 #define VK_LBUTTON 0x01
48 #define VK_RBUTTON 0x02
49 #define VK_CANCEL 0x03
50 #define VK_MBUTTON 0x04
51 #define VK_XBUTTON1 0x05
52 #define VK_XBUTTON2 0x06
62 #define VK_RETURN 0x0D
67 #define VK_CONTROL 0x11
70 #define VK_CAPITAL 0x14
75 #define VK_HANGUL 0x15
87 #define VK_ESCAPE 0x1B
88 #define VK_CONVERT 0x1C
89 #define VK_NONCONVERT 0x1D
90 #define VK_ACCEPT 0x1E
91 #define VK_MODECHANGE 0x1F
100 #define VK_RIGHT 0x27
102 #define VK_SELECT 0x29
103 #define VK_PRINT 0x2A
104 #define VK_EXECUTE 0x2B
105 #define VK_SNAPSHOT 0x2C
106 #define VK_INSERT 0x2D
107 #define VK_DELETE 0x2E
112 #define VK_KEY_0 0x30
113 #define VK_KEY_1 0x31
114 #define VK_KEY_2 0x32
115 #define VK_KEY_3 0x33
116 #define VK_KEY_4 0x34
117 #define VK_KEY_5 0x35
118 #define VK_KEY_6 0x36
119 #define VK_KEY_7 0x37
120 #define VK_KEY_8 0x38
121 #define VK_KEY_9 0x39
127 #define VK_KEY_A 0x41
128 #define VK_KEY_B 0x42
129 #define VK_KEY_C 0x43
130 #define VK_KEY_D 0x44
131 #define VK_KEY_E 0x45
132 #define VK_KEY_F 0x46
133 #define VK_KEY_G 0x47
134 #define VK_KEY_H 0x48
135 #define VK_KEY_I 0x49
136 #define VK_KEY_J 0x4A
137 #define VK_KEY_K 0x4B
138 #define VK_KEY_L 0x4C
139 #define VK_KEY_M 0x4D
140 #define VK_KEY_N 0x4E
141 #define VK_KEY_O 0x4F
142 #define VK_KEY_P 0x50
143 #define VK_KEY_Q 0x51
144 #define VK_KEY_R 0x52
145 #define VK_KEY_S 0x53
146 #define VK_KEY_T 0x54
147 #define VK_KEY_U 0x55
148 #define VK_KEY_V 0x56
149 #define VK_KEY_W 0x57
150 #define VK_KEY_X 0x58
151 #define VK_KEY_Y 0x59
152 #define VK_KEY_Z 0x5A
160 #define VK_POWER 0x5E
162 #define VK_SLEEP 0x5F
166 #define VK_NUMPAD0 0x60
167 #define VK_NUMPAD1 0x61
168 #define VK_NUMPAD2 0x62
169 #define VK_NUMPAD3 0x63
170 #define VK_NUMPAD4 0x64
171 #define VK_NUMPAD5 0x65
172 #define VK_NUMPAD6 0x66
173 #define VK_NUMPAD7 0x67
174 #define VK_NUMPAD8 0x68
175 #define VK_NUMPAD9 0x69
179 #define VK_MULTIPLY 0x6A
181 #define VK_SEPARATOR 0x6C
182 #define VK_SUBTRACT 0x6D
183 #define VK_DECIMAL 0x6E
184 #define VK_DIVIDE 0x6F
215 #define VK_NUMLOCK 0x90
216 #define VK_SCROLL 0x91
223 #define VK_LSHIFT 0xA0
224 #define VK_RSHIFT 0xA1
225 #define VK_LCONTROL 0xA2
226 #define VK_RCONTROL 0xA3
227 #define VK_LMENU 0xA4
228 #define VK_RMENU 0xA5
232 #define VK_BROWSER_BACK 0xA6
233 #define VK_BROWSER_FORWARD 0xA7
234 #define VK_BROWSER_REFRESH 0xA8
235 #define VK_BROWSER_STOP 0xA9
236 #define VK_BROWSER_SEARCH 0xAA
237 #define VK_BROWSER_FAVORITES 0xAB
238 #define VK_BROWSER_HOME 0xAC
242 #define VK_VOLUME_MUTE 0xAD
243 #define VK_VOLUME_DOWN 0xAE
244 #define VK_VOLUME_UP 0xAF
248 #define VK_MEDIA_NEXT_TRACK 0xB0
249 #define VK_MEDIA_PREV_TRACK 0xB1
250 #define VK_MEDIA_STOP 0xB2
251 #define VK_MEDIA_PLAY_PAUSE 0xB3
255 #define VK_LAUNCH_MAIL 0xB4
256 #define VK_MEDIA_SELECT 0xB5
257 #define VK_LAUNCH_MEDIA_SELECT 0xB5
258 #define VK_LAUNCH_APP1 0xB6
259 #define VK_LAUNCH_APP2 0xB7
265 #define VK_OEM_1 0xBA
268 #define VK_OEM_PLUS 0xBB
269 #define VK_OEM_COMMA 0xBC
270 #define VK_OEM_MINUS 0xBD
271 #define VK_OEM_PERIOD 0xBE
273 #define VK_OEM_2 0xBF
276 #define VK_OEM_3 0xC0
280 #define VK_ABNT_C1 0xC1
281 #define VK_ABNT_C2 0xC2
285 #define VK_OEM_4 0xDB
288 #define VK_OEM_5 0xDC
291 #define VK_OEM_6 0xDD
294 #define VK_OEM_7 0xDE
297 #define VK_OEM_8 0xDF
301 #define VK_OEM_AX 0xE1
303 #define VK_OEM_102 0xE2
308 #define VK_PROCESSKEY \
323 #define VK_OEM_RESET 0xE9
324 #define VK_OEM_JUMP 0xEA
325 #define VK_OEM_PA1 0xEB
326 #define VK_OEM_PA2 0xEC
327 #define VK_OEM_PA3 0xED
328 #define VK_OEM_WSCTRL 0xEE
329 #define VK_OEM_CUSEL 0xEF
330 #define VK_OEM_ATTN 0xF0
331 #define VK_OEM_FINISH 0xF1
332 #define VK_OEM_COPY 0xF2
333 #define VK_OEM_AUTO 0xF3
334 #define VK_OEM_ENLW 0xF4
335 #define VK_OEM_BACKTAB 0xF5
338 #define VK_CRSEL 0xF7
339 #define VK_EXSEL 0xF8
340 #define VK_EREOF 0xF9
343 #define VK_NONAME 0xFC
345 #define VK_OEM_CLEAR 0xFE
354 #define VK_DBE_ALPHANUMERIC 0xF0
355 #define VK_DBE_KATAKANA 0xF1
356 #define VK_DBE_HIRAGANA 0xF2
357 #define VK_DBE_SBCSCHAR 0xF3
358 #define VK_DBE_DBCSCHAR 0xF4
359 #define VK_DBE_ROMAN 0xF5
360 #define VK_DBE_NOROMAN 0xF6
361 #define VK_DBE_ENTERWORDREGISTERMODE 0xF7
362 #define VK_DBE_ENTERIMECONFIGMODE \
364 #define VK_DBE_FLUSHSTRING 0xF9
365 #define VK_DBE_CODEINPUT 0xFA
366 #define VK_DBE_NOCODEINPUT 0xFB
376 #define KBD4_T00 VK_NONE
377 #define KBD4_T01 VK_ESCAPE
378 #define KBD4_T02 VK_KEY_1
379 #define KBD4_T03 VK_KEY_2
380 #define KBD4_T04 VK_KEY_3
381 #define KBD4_T05 VK_KEY_4
382 #define KBD4_T06 VK_KEY_5
383 #define KBD4_T07 VK_KEY_6
384 #define KBD4_T08 VK_KEY_7
385 #define KBD4_T09 VK_KEY_8
386 #define KBD4_T0A VK_KEY_9
387 #define KBD4_T0B VK_KEY_0
388 #define KBD4_T0C VK_OEM_MINUS
389 #define KBD4_T0D VK_OEM_PLUS
390 #define KBD4_T0E VK_BACK
391 #define KBD4_T0F VK_TAB
392 #define KBD4_T10 VK_KEY_Q
393 #define KBD4_T11 VK_KEY_W
394 #define KBD4_T12 VK_KEY_E
395 #define KBD4_T13 VK_KEY_R
396 #define KBD4_T14 VK_KEY_T
397 #define KBD4_T15 VK_KEY_Y
398 #define KBD4_T16 VK_KEY_U
399 #define KBD4_T17 VK_KEY_I
400 #define KBD4_T18 VK_KEY_O
401 #define KBD4_T19 VK_KEY_P
402 #define KBD4_T1A VK_OEM_4
403 #define KBD4_T1B VK_OEM_6
404 #define KBD4_T1C VK_RETURN
405 #define KBD4_T1D VK_LCONTROL
406 #define KBD4_T1E VK_KEY_A
407 #define KBD4_T1F VK_KEY_S
408 #define KBD4_T20 VK_KEY_D
409 #define KBD4_T21 VK_KEY_F
410 #define KBD4_T22 VK_KEY_G
411 #define KBD4_T23 VK_KEY_H
412 #define KBD4_T24 VK_KEY_J
413 #define KBD4_T25 VK_KEY_K
414 #define KBD4_T26 VK_KEY_L
415 #define KBD4_T27 VK_OEM_1
416 #define KBD4_T28 VK_OEM_7
417 #define KBD4_T29 VK_OEM_3
418 #define KBD4_T2A VK_LSHIFT
419 #define KBD4_T2B VK_OEM_5
420 #define KBD4_T2C VK_KEY_Z
421 #define KBD4_T2D VK_KEY_X
422 #define KBD4_T2E VK_KEY_C
423 #define KBD4_T2F VK_KEY_V
424 #define KBD4_T30 VK_KEY_B
425 #define KBD4_T31 VK_KEY_N
426 #define KBD4_T32 VK_KEY_M
427 #define KBD4_T33 VK_OEM_COMMA
428 #define KBD4_T34 VK_OEM_PERIOD
429 #define KBD4_T35 VK_OEM_2
430 #define KBD4_T36 VK_RSHIFT
431 #define KBD4_T37 VK_MULTIPLY
432 #define KBD4_T38 VK_LMENU
433 #define KBD4_T39 VK_SPACE
434 #define KBD4_T3A VK_CAPITAL
435 #define KBD4_T3B VK_F1
436 #define KBD4_T3C VK_F2
437 #define KBD4_T3D VK_F3
438 #define KBD4_T3E VK_F4
439 #define KBD4_T3F VK_F5
440 #define KBD4_T40 VK_F6
441 #define KBD4_T41 VK_F7
442 #define KBD4_T42 VK_F8
443 #define KBD4_T43 VK_F9
444 #define KBD4_T44 VK_F10
445 #define KBD4_T45 VK_NUMLOCK
446 #define KBD4_T46 VK_SCROLL
447 #define KBD4_T47 VK_NUMPAD7
448 #define KBD4_T48 VK_NUMPAD8
449 #define KBD4_T49 VK_NUMPAD9
450 #define KBD4_T4A VK_SUBTRACT
451 #define KBD4_T4B VK_NUMPAD4
452 #define KBD4_T4C VK_NUMPAD5
453 #define KBD4_T4D VK_NUMPAD6
454 #define KBD4_T4E VK_ADD
455 #define KBD4_T4F VK_NUMPAD1
456 #define KBD4_T50 VK_NUMPAD2
457 #define KBD4_T51 VK_NUMPAD3
458 #define KBD4_T52 VK_NUMPAD0
459 #define KBD4_T53 VK_DECIMAL
460 #define KBD4_T54 VK_SNAPSHOT
461 #define KBD4_T55 VK_NONE
462 #define KBD4_T56 VK_OEM_102
463 #define KBD4_T57 VK_F11
464 #define KBD4_T58 VK_F12
465 #define KBD4_T59 VK_CLEAR
466 #define KBD4_T5A VK_OEM_WSCTRL
467 #define KBD4_T5B VK_OEM_FINISH
468 #define KBD4_T5C VK_OEM_JUMP
469 #define KBD4_T5D VK_EREOF
470 #define KBD4_T5E VK_OEM_BACKTAB
471 #define KBD4_T5F VK_OEM_AUTO
472 #define KBD4_T60 VK_NONE
473 #define KBD4_T61 VK_NONE
474 #define KBD4_T62 VK_ZOOM
475 #define KBD4_T63 VK_HELP
476 #define KBD4_T64 VK_F13
477 #define KBD4_T65 VK_F14
478 #define KBD4_T66 VK_F15
479 #define KBD4_T67 VK_F16
480 #define KBD4_T68 VK_F17
481 #define KBD4_T69 VK_F18
482 #define KBD4_T6A VK_F19
483 #define KBD4_T6B VK_F20
484 #define KBD4_T6C VK_F21
485 #define KBD4_T6D VK_F22
486 #define KBD4_T6E VK_F23
487 #define KBD4_T6F VK_OEM_PA3
488 #define KBD4_T70 VK_NONE
489 #define KBD4_T71 VK_OEM_RESET
490 #define KBD4_T72 VK_NONE
491 #define KBD4_T73 VK_ABNT_C1
492 #define KBD4_T74 VK_NONE
493 #define KBD4_T75 VK_NONE
494 #define KBD4_T76 VK_F24
495 #define KBD4_T77 VK_NONE
496 #define KBD4_T78 VK_NONE
497 #define KBD4_T79 VK_NONE
498 #define KBD4_T7A VK_NONE
499 #define KBD4_T7B VK_OEM_PA1
500 #define KBD4_T7C VK_TAB
501 #define KBD4_T7D VK_NONE
502 #define KBD4_T7E VK_ABNT_C2
503 #define KBD4_T7F VK_OEM_PA2
505 #define KBD4_X10 VK_MEDIA_PREV_TRACK
506 #define KBD4_X19 VK_MEDIA_NEXT_TRACK
507 #define KBD4_X1C VK_RETURN
508 #define KBD4_X1D VK_RCONTROL
509 #define KBD4_X20 VK_VOLUME_MUTE
510 #define KBD4_X21 VK_LAUNCH_APP2
511 #define KBD4_X22 VK_MEDIA_PLAY_PAUSE
512 #define KBD4_X24 VK_MEDIA_STOP
513 #define KBD4_X2E VK_VOLUME_DOWN
514 #define KBD4_X30 VK_VOLUME_UP
515 #define KBD4_X32 VK_BROWSER_HOME
516 #define KBD4_X35 VK_DIVIDE
517 #define KBD4_X37 VK_SNAPSHOT
518 #define KBD4_X38 VK_RMENU
519 #define KBD4_X46 VK_PAUSE
520 #define KBD4_X47 VK_HOME
521 #define KBD4_X48 VK_UP
522 #define KBD4_X49 VK_PRIOR
523 #define KBD4_X4B VK_LEFT
524 #define KBD4_X4D VK_RIGHT
525 #define KBD4_X4F VK_END
526 #define KBD4_X50 VK_DOWN
527 #define KBD4_X51 VK_NEXT
528 #define KBD4_X52 VK_INSERT
529 #define KBD4_X53 VK_DELETE
530 #define KBD4_X5B VK_LWIN
531 #define KBD4_X5C VK_RWIN
532 #define KBD4_X5D VK_APPS
533 #define KBD4_X5E VK_POWER
534 #define KBD4_X5F VK_SLEEP
535 #define KBD4_X65 VK_BROWSER_SEARCH
536 #define KBD4_X66 VK_BROWSER_FAVORITES
537 #define KBD4_X67 VK_BROWSER_REFRESH
538 #define KBD4_X68 VK_BROWSER_STOP
539 #define KBD4_X69 VK_BROWSER_FORWARD
540 #define KBD4_X6A VK_BROWSER_BACK
541 #define KBD4_X6B VK_LAUNCH_APP1
542 #define KBD4_X6C VK_LAUNCH_MAIL
543 #define KBD4_X6D VK_LAUNCH_MEDIA_SELECT
545 #define KBD4_Y1D VK_PAUSE
551 #define KBD7_T00 VK_NONE
552 #define KBD7_T01 VK_ESCAPE
553 #define KBD7_T02 VK_KEY_1
554 #define KBD7_T03 VK_KEY_2
555 #define KBD7_T04 VK_KEY_3
556 #define KBD7_T05 VK_KEY_4
557 #define KBD7_T06 VK_KEY_5
558 #define KBD7_T07 VK_KEY_6
559 #define KBD7_T08 VK_KEY_7
560 #define KBD7_T09 VK_KEY_8
561 #define KBD7_T0A VK_KEY_9
562 #define KBD7_T0B VK_KEY_0
563 #define KBD7_T0C VK_OEM_MINUS
564 #define KBD7_T0D VK_OEM_PLUS
565 #define KBD7_T0E VK_BACK
566 #define KBD7_T0F VK_TAB
567 #define KBD7_T10 VK_KEY_Q
568 #define KBD7_T11 VK_KEY_W
569 #define KBD7_T12 VK_KEY_E
570 #define KBD7_T13 VK_KEY_R
571 #define KBD7_T14 VK_KEY_T
572 #define KBD7_T15 VK_KEY_Y
573 #define KBD7_T16 VK_KEY_U
574 #define KBD7_T17 VK_KEY_I
575 #define KBD7_T18 VK_KEY_O
576 #define KBD7_T19 VK_KEY_P
577 #define KBD7_T1A VK_OEM_4
578 #define KBD7_T1B VK_OEM_6
579 #define KBD7_T1C VK_RETURN
580 #define KBD7_T1D VK_LCONTROL
581 #define KBD7_T1E VK_KEY_A
582 #define KBD7_T1F VK_KEY_S
583 #define KBD7_T20 VK_KEY_D
584 #define KBD7_T21 VK_KEY_F
585 #define KBD7_T22 VK_KEY_G
586 #define KBD7_T23 VK_KEY_H
587 #define KBD7_T24 VK_KEY_J
588 #define KBD7_T25 VK_KEY_K
589 #define KBD7_T26 VK_KEY_L
590 #define KBD7_T27 VK_OEM_1
591 #define KBD7_T28 VK_OEM_7
592 #define KBD7_T29 VK_OEM_3
593 #define KBD7_T2A VK_LSHIFT
594 #define KBD7_T2B VK_OEM_5
595 #define KBD7_T2C VK_KEY_Z
596 #define KBD7_T2D VK_KEY_X
597 #define KBD7_T2E VK_KEY_C
598 #define KBD7_T2F VK_KEY_V
599 #define KBD7_T30 VK_KEY_B
600 #define KBD7_T31 VK_KEY_N
601 #define KBD7_T32 VK_KEY_M
602 #define KBD7_T33 VK_OEM_COMMA
603 #define KBD7_T34 VK_OEM_PERIOD
604 #define KBD7_T35 VK_OEM_2
605 #define KBD7_T36 VK_RSHIFT
606 #define KBD7_T37 VK_MULTIPLY
607 #define KBD7_T38 VK_LMENU
608 #define KBD7_T39 VK_SPACE
609 #define KBD7_T3A VK_CAPITAL
610 #define KBD7_T3B VK_F1
611 #define KBD7_T3C VK_F2
612 #define KBD7_T3D VK_F3
613 #define KBD7_T3E VK_F4
614 #define KBD7_T3F VK_F5
615 #define KBD7_T40 VK_F6
616 #define KBD7_T41 VK_F7
617 #define KBD7_T42 VK_F8
618 #define KBD7_T43 VK_F9
619 #define KBD7_T44 VK_F10
620 #define KBD7_T45 VK_NUMLOCK
621 #define KBD7_T46 VK_SCROLL
622 #define KBD7_T47 VK_NUMPAD7
623 #define KBD7_T48 VK_NUMPAD8
624 #define KBD7_T49 VK_NUMPAD9
625 #define KBD7_T4A VK_SUBTRACT
626 #define KBD7_T4B VK_NUMPAD4
627 #define KBD7_T4C VK_NUMPAD5
628 #define KBD7_T4D VK_NUMPAD6
629 #define KBD7_T4E VK_ADD
630 #define KBD7_T4F VK_NUMPAD1
631 #define KBD7_T50 VK_NUMPAD2
632 #define KBD7_T51 VK_NUMPAD3
633 #define KBD7_T52 VK_NUMPAD0
634 #define KBD7_T53 VK_DECIMAL
635 #define KBD7_T54 VK_SNAPSHOT
636 #define KBD7_T55 VK_NONE
637 #define KBD7_T56 VK_OEM_102
638 #define KBD7_T57 VK_F11
639 #define KBD7_T58 VK_F12
640 #define KBD7_T59 VK_CLEAR
641 #define KBD7_T5A VK_NONAME
642 #define KBD7_T5B VK_NONAME
643 #define KBD7_T5C VK_NONAME
644 #define KBD7_T5D VK_EREOF
645 #define KBD7_T5E VK_NONE
646 #define KBD7_T5F VK_NONAME
647 #define KBD7_T60 VK_NONE
648 #define KBD7_T61 VK_NONE
649 #define KBD7_T62 VK_NONE
650 #define KBD7_T63 VK_NONE
651 #define KBD7_T64 VK_F13
652 #define KBD7_T65 VK_F14
653 #define KBD7_T66 VK_F15
654 #define KBD7_T67 VK_F16
655 #define KBD7_T68 VK_F17
656 #define KBD7_T69 VK_F18
657 #define KBD7_T6A VK_F19
658 #define KBD7_T6B VK_F20
659 #define KBD7_T6C VK_F21
660 #define KBD7_T6D VK_F22
661 #define KBD7_T6E VK_F23
662 #define KBD7_T6F VK_NONE
663 #define KBD7_T70 VK_HKTG
664 #define KBD7_T71 VK_NONE
665 #define KBD7_T72 VK_NONE
666 #define KBD7_T73 VK_ABNT_C1
667 #define KBD7_T74 VK_NONE
668 #define KBD7_T75 VK_NONE
669 #define KBD7_T76 VK_F24
670 #define KBD7_T77 VK_NONE
671 #define KBD7_T78 VK_NONE
672 #define KBD7_T79 VK_CONVERT
673 #define KBD7_T7A VK_NONE
674 #define KBD7_T7B VK_NONCONVERT
675 #define KBD7_T7C VK_TAB
676 #define KBD7_T7D VK_OEM_8
677 #define KBD7_T7E VK_ABNT_C2
678 #define KBD7_T7F VK_OEM_PA2
680 #define KBD7_X10 VK_MEDIA_PREV_TRACK
681 #define KBD7_X19 VK_MEDIA_NEXT_TRACK
682 #define KBD7_X1C VK_RETURN
683 #define KBD7_X1D VK_RCONTROL
684 #define KBD7_X20 VK_VOLUME_MUTE
685 #define KBD7_X21 VK_LAUNCH_APP2
686 #define KBD7_X22 VK_MEDIA_PLAY_PAUSE
687 #define KBD7_X24 VK_MEDIA_STOP
688 #define KBD7_X2E VK_VOLUME_DOWN
689 #define KBD7_X30 VK_VOLUME_UP
690 #define KBD7_X32 VK_BROWSER_HOME
691 #define KBD7_X33 VK_NONE
692 #define KBD7_X35 VK_DIVIDE
693 #define KBD7_X37 VK_SNAPSHOT
694 #define KBD7_X38 VK_RMENU
695 #define KBD7_X42 VK_NONE
696 #define KBD7_X43 VK_NONE
697 #define KBD7_X44 VK_NONE
698 #define KBD7_X46 VK_CANCEL
699 #define KBD7_X47 VK_HOME
700 #define KBD7_X48 VK_UP
701 #define KBD7_X49 VK_PRIOR
702 #define KBD7_X4B VK_LEFT
703 #define KBD7_X4D VK_RIGHT
704 #define KBD7_X4F VK_END
705 #define KBD7_X50 VK_DOWN
706 #define KBD7_X51 VK_NEXT
707 #define KBD7_X52 VK_INSERT
708 #define KBD7_X53 VK_DELETE
709 #define KBD7_X5B VK_LWIN
710 #define KBD7_X5C VK_RWIN
711 #define KBD7_X5D VK_APPS
712 #define KBD7_X5E VK_POWER
713 #define KBD7_X5F VK_SLEEP
714 #define KBD7_X65 VK_BROWSER_SEARCH
715 #define KBD7_X66 VK_BROWSER_FAVORITES
716 #define KBD7_X67 VK_BROWSER_REFRESH
717 #define KBD7_X68 VK_BROWSER_STOP
718 #define KBD7_X69 VK_BROWSER_FORWARD
719 #define KBD7_X6A VK_BROWSER_BACK
720 #define KBD7_X6B VK_LAUNCH_APP1
721 #define KBD7_X6C VK_LAUNCH_MAIL
722 #define KBD7_X6D VK_LAUNCH_MEDIA_SELECT
723 #define KBD7_XF1 VK_NONE
724 #define KBD7_XF2 VK_NONE
726 #define KBD7_Y1D VK_PAUSE
736 #define APPLE_VK_ANSI_A 0x00
737 #define APPLE_VK_ANSI_S 0x01
738 #define APPLE_VK_ANSI_D 0x02
739 #define APPLE_VK_ANSI_F 0x03
740 #define APPLE_VK_ANSI_H 0x04
741 #define APPLE_VK_ANSI_G 0x05
742 #define APPLE_VK_ANSI_Z 0x06
743 #define APPLE_VK_ANSI_X 0x07
744 #define APPLE_VK_ANSI_C 0x08
745 #define APPLE_VK_ANSI_V 0x09
746 #define APPLE_VK_ISO_Section 0x0A
747 #define APPLE_VK_ANSI_B 0x0B
748 #define APPLE_VK_ANSI_Q 0x0C
749 #define APPLE_VK_ANSI_W 0x0D
750 #define APPLE_VK_ANSI_E 0x0E
751 #define APPLE_VK_ANSI_R 0x0F
752 #define APPLE_VK_ANSI_Y 0x10
753 #define APPLE_VK_ANSI_T 0x11
754 #define APPLE_VK_ANSI_1 0x12
755 #define APPLE_VK_ANSI_2 0x13
756 #define APPLE_VK_ANSI_3 0x14
757 #define APPLE_VK_ANSI_4 0x15
758 #define APPLE_VK_ANSI_6 0x16
759 #define APPLE_VK_ANSI_5 0x17
760 #define APPLE_VK_ANSI_Equal 0x18
761 #define APPLE_VK_ANSI_9 0x19
762 #define APPLE_VK_ANSI_7 0x1A
763 #define APPLE_VK_ANSI_Minus 0x1B
764 #define APPLE_VK_ANSI_8 0x1C
765 #define APPLE_VK_ANSI_0 0x1D
766 #define APPLE_VK_ANSI_RightBracket 0x1E
767 #define APPLE_VK_ANSI_O 0x1F
768 #define APPLE_VK_ANSI_U 0x20
769 #define APPLE_VK_ANSI_LeftBracket 0x21
770 #define APPLE_VK_ANSI_I 0x22
771 #define APPLE_VK_ANSI_P 0x23
772 #define APPLE_VK_Return 0x24
773 #define APPLE_VK_ANSI_L 0x25
774 #define APPLE_VK_ANSI_J 0x26
775 #define APPLE_VK_ANSI_Quote 0x27
776 #define APPLE_VK_ANSI_K 0x28
777 #define APPLE_VK_ANSI_Semicolon 0x29
778 #define APPLE_VK_ANSI_Backslash 0x2A
779 #define APPLE_VK_ANSI_Comma 0x2B
780 #define APPLE_VK_ANSI_Slash 0x2C
781 #define APPLE_VK_ANSI_N 0x2D
782 #define APPLE_VK_ANSI_M 0x2E
783 #define APPLE_VK_ANSI_Period 0x2F
784 #define APPLE_VK_Tab 0x30
785 #define APPLE_VK_Space 0x31
786 #define APPLE_VK_ANSI_Grave 0x32
787 #define APPLE_VK_Delete 0x33
788 #define APPLE_VK_0x34 0x34
789 #define APPLE_VK_Escape 0x35
790 #define APPLE_VK_0x36 0x36
791 #define APPLE_VK_Command 0x37
792 #define APPLE_VK_Shift 0x38
793 #define APPLE_VK_CapsLock 0x39
794 #define APPLE_VK_Option 0x3A
795 #define APPLE_VK_Control 0x3B
796 #define APPLE_VK_RightShift 0x3C
797 #define APPLE_VK_RightOption 0x3D
798 #define APPLE_VK_RightControl 0x3E
799 #define APPLE_VK_Function 0x3F
800 #define APPLE_VK_F17 0x40
801 #define APPLE_VK_ANSI_KeypadDecimal 0x41
802 #define APPLE_VK_0x42 0x42
803 #define APPLE_VK_ANSI_KeypadMultiply 0x43
804 #define APPLE_VK_0x44 0x44
805 #define APPLE_VK_ANSI_KeypadPlus 0x45
806 #define APPLE_VK_0x46 0x46
807 #define APPLE_VK_ANSI_KeypadClear 0x47
808 #define APPLE_VK_VolumeUp 0x48
809 #define APPLE_VK_VolumeDown 0x49
810 #define APPLE_VK_Mute 0x4A
811 #define APPLE_VK_ANSI_KeypadDivide 0x4B
812 #define APPLE_VK_ANSI_KeypadEnter 0x4C
813 #define APPLE_VK_0x4D 0x4D
814 #define APPLE_VK_ANSI_KeypadMinus 0x4E
815 #define APPLE_VK_F18 0x4F
816 #define APPLE_VK_F19 0x50
817 #define APPLE_VK_ANSI_KeypadEquals 0x51
818 #define APPLE_VK_ANSI_Keypad0 0x52
819 #define APPLE_VK_ANSI_Keypad1 0x53
820 #define APPLE_VK_ANSI_Keypad2 0x54
821 #define APPLE_VK_ANSI_Keypad3 0x55
822 #define APPLE_VK_ANSI_Keypad4 0x56
823 #define APPLE_VK_ANSI_Keypad5 0x57
824 #define APPLE_VK_ANSI_Keypad6 0x58
825 #define APPLE_VK_ANSI_Keypad7 0x59
826 #define APPLE_VK_F20 0x5A
827 #define APPLE_VK_ANSI_Keypad8 0x5B
828 #define APPLE_VK_ANSI_Keypad9 0x5C
829 #define APPLE_VK_JIS_Yen 0x5D
830 #define APPLE_VK_JIS_Underscore 0x5E
831 #define APPLE_VK_JIS_KeypadComma 0x5F
832 #define APPLE_VK_F5 0x60
833 #define APPLE_VK_F6 0x61
834 #define APPLE_VK_F7 0x62
835 #define APPLE_VK_F3 0x63
836 #define APPLE_VK_F8 0x64
837 #define APPLE_VK_F9 0x65
838 #define APPLE_VK_JIS_Eisu 0x66
839 #define APPLE_VK_F11 0x67
840 #define APPLE_VK_JIS_Kana 0x68
841 #define APPLE_VK_F13 0x69
842 #define APPLE_VK_F16 0x6A
843 #define APPLE_VK_F14 0x6B
844 #define APPLE_VK_F10 0x6D
845 #define APPLE_VK_0x6C 0x6C
846 #define APPLE_VK_0x6E 0x6E
847 #define APPLE_VK_F12 0x6F
848 #define APPLE_VK_0x70 0x70
849 #define APPLE_VK_F15 0x71
850 #define APPLE_VK_Help 0x72
851 #define APPLE_VK_Home 0x73
852 #define APPLE_VK_PageUp 0x74
853 #define APPLE_VK_ForwardDelete 0x75
854 #define APPLE_VK_F4 0x76
855 #define APPLE_VK_End 0x77
856 #define APPLE_VK_F2 0x78
857 #define APPLE_VK_PageDown 0x79
858 #define APPLE_VK_F1 0x7A
859 #define APPLE_VK_LeftArrow 0x7B
860 #define APPLE_VK_RightArrow 0x7C
861 #define APPLE_VK_DownArrow 0x7D
862 #define APPLE_VK_UpArrow 0x7E
872 WINPR_KBD_TYPE_IBM_PC_XT = 0x00000001,
873 WINPR_KBD_TYPE_OLIVETTI_ICO = 0x00000002,
874 WINPR_KBD_TYPE_IBM_PC_AT = 0x00000003,
875 WINPR_KBD_TYPE_IBM_ENHANCED = 0x00000004,
876 WINPR_KBD_TYPE_NOKIA_1050 = 0x00000005,
877 WINPR_KBD_TYPE_NOKIA_9140 = 0x00000006,
878 WINPR_KBD_TYPE_JAPANESE = 0x00000007
885 WINPR_API
const char* GetVirtualKeyName(DWORD vkcode);
886 WINPR_API DWORD GetVirtualKeyCodeFromName(
const char* vkname);
887 WINPR_API DWORD GetVirtualKeyCodeFromXkbKeyName(
const char* xkbname);
889 WINPR_API DWORD GetVirtualKeyCodeFromVirtualScanCode(DWORD scancode,
890 DWORD dwKeyboardType);
891 WINPR_API DWORD GetVirtualScanCodeFromVirtualKeyCode(DWORD vkcode,
892 DWORD dwKeyboardType);
896 WINPR_KEYCODE_TYPE_NONE = 0x00000000,
897 WINPR_KEYCODE_TYPE_APPLE = 0x00000001,
898 WINPR_KEYCODE_TYPE_EVDEV = 0x00000002,
899 WINPR_KEYCODE_TYPE_XKB = 0x00000003
900 } WINPR_KEYCODE_TYPE;
902 WINPR_API DWORD GetVirtualKeyCodeFromKeycode(DWORD keycode, WINPR_KEYCODE_TYPE type);
903 WINPR_API DWORD GetKeycodeFromVirtualKeyCode(DWORD keycode, WINPR_KEYCODE_TYPE type);