Debian Codegraph @

testing/web-platform/tests/tools/wave/www/lib/keycodes.js

raw
1 if (typeof KeyEvent != "undefined") {
2 if (typeof KeyEvent.VK_LEFT != "undefined") {
3 var VK_LEFT = KeyEvent.VK_LEFT;
4 var VK_UP = KeyEvent.VK_UP;
5 var VK_RIGHT = KeyEvent.VK_RIGHT;
6 var VK_DOWN = KeyEvent.VK_DOWN;
7 }
8 if (typeof KeyEvent.VK_ENTER != "undefined") {
9 var VK_ENTER = KeyEvent.VK_ENTER;
10 }
11 if (typeof KeyEvent.VK_RED != "undefined") {
12 var VK_RED = KeyEvent.VK_RED;
13 var VK_GREEN = KeyEvent.VK_GREEN;
14 var VK_YELLOW = KeyEvent.VK_YELLOW;
15 var VK_BLUE = KeyEvent.VK_BLUE;
16 }
17 if (typeof KeyEvent.VK_PLAY != "undefined") {
18 var VK_PLAY = KeyEvent.VK_PLAY;
19 var VK_PAUSE = KeyEvent.VK_PAUSE;
20 var VK_STOP = KeyEvent.VK_STOP;
21 }
22 if (typeof KeyEvent.VK_BACK != "undefined") {
23 var VK_BACK = KeyEvent.VK_BACK;
24 }
25 if (typeof KeyEvent.VK_0 != "undefined") {
26 var VK_0 = KeyEvent.VK_0;
27 var VK_1 = KeyEvent.VK_1;
28 var VK_2 = KeyEvent.VK_2;
29 var VK_3 = KeyEvent.VK_3;
30 var VK_4 = KeyEvent.VK_4;
31 var VK_5 = KeyEvent.VK_5;
32 var VK_6 = KeyEvent.VK_6;
33 var VK_7 = KeyEvent.VK_7;
34 var VK_8 = KeyEvent.VK_8;
35 var VK_9 = KeyEvent.VK_9;
36 }
37 }
38 if (typeof VK_LEFT == "undefined") {
39 var VK_LEFT = 132;
40 var VK_UP = 130;
41 var VK_RIGHT = 133;
42 var VK_DOWN = 131;
43 }
44 if (typeof VK_ENTER == "undefined") {
45 var VK_ENTER = 13;
46 }
47 if (typeof VK_RED == "undefined") {
48 var VK_RED = 403;
49 var VK_GREEN = 404;
50 var VK_YELLOW = 502;
51 var VK_BLUE = 406;
52 }
53 if (typeof VK_PLAY == "undefined") {
54 var VK_PLAY = 19;
55 var VK_PAUSE = 19;
56 var VK_STOP = 413;
57 }
58 if (typeof VK_BACK == "undefined") {
59 var VK_BACK = 0xa6;
60 }
61 if (typeof VK_0 == "undefined") {
62 var VK_0 = 48;
63 var VK_1 = 49;
64 var VK_2 = 50;
65 var VK_3 = 51;
66 var VK_4 = 52;
67 var VK_5 = 53;
68 var VK_6 = 54;
69 var VK_7 = 55;
70 var VK_8 = 56;
71 var VK_9 = 57;
72 }
73
74 var NEXT_KEYS = [39, 133, 131];
75 var PREV_KEYS = [37, 132, 130];
76 var ACTION_KEYS = [13, 32];
77
78 if (typeof KeyEvent != "undefined") {
79 if (typeof KeyEvent.VK_LEFT != "undefined") {
80 PREV_KEYS.push(KeyEvent.VK_LEFT);
81 PREV_KEYS.push(KeyEvent.VK_UP);
82 NEXT_KEYS.push(KeyEvent.VK_RIGHT);
83 NEXT_KEYS.push(KeyEvent.VK_DOWN);
84 }
85 if (typeof KeyEvent.VK_ENTER != "undefined") {
86 ACTION_KEYS.push(KeyEvent.VK_ENTER);
87 }
88 }