This source file includes following definitions.
- NativeKeyCodeForWindowsKeyCode
#include "content/shell/renderer/test_runner/KeyCodeMapping.h"
#include "content/shell/renderer/test_runner/TestCommon.h"
namespace WebTestRunner {
int NativeKeyCodeForWindowsKeyCode(int keysym)
{
#if defined(__linux__) && defined(TOOLKIT_GTK)
static const int asciiToKeyCode[] = {
0,
0,
0,
0,
0,
0,
0,
0,
22,
23,
0,
0,
0,
36,
0,
0,
50,
37,
64,
127,
66,
0,
0,
0,
0,
131,
0,
9,
100,
102,
0,
0,
65,
112,
117,
115,
110,
113,
111,
114,
116,
0,
107,
0,
0,
118,
119,
146,
19,
10,
11,
12,
13,
14,
15,
16,
17,
18,
0,
0,
0,
0,
0,
0,
0,
38,
56,
54,
40,
26,
41,
42,
43,
31,
44,
45,
46,
58,
57,
32,
33,
24,
27,
39,
28,
30,
55,
25,
53,
29,
52,
133,
134,
135,
0,
0,
90,
38,
56,
54,
40,
26,
41,
42,
43,
31,
44,
45,
46,
58,
57,
32,
33,
24,
27,
39,
28,
30,
55,
25,
53,
29,
52,
96,
0,
0,
0,
0,
};
if (keysym <= 127)
return asciiToKeyCode[keysym];
switch (keysym) {
case VKEY_PRIOR:
return 112;
case VKEY_NEXT:
return 117;
case VKEY_END:
return 115;
case VKEY_HOME:
return 110;
case VKEY_LEFT:
return 113;
case VKEY_UP:
return 111;
case VKEY_RIGHT:
return 114;
case VKEY_DOWN:
return 116;
case VKEY_SNAPSHOT:
return 107;
case VKEY_INSERT:
return 118;
case VKEY_DELETE:
return 119;
case VKEY_APPS:
return 135;
case VKEY_F1:
case VKEY_F1 + 1:
case VKEY_F1 + 2:
case VKEY_F1 + 3:
case VKEY_F1 + 4:
case VKEY_F1 + 5:
case VKEY_F1 + 6:
case VKEY_F1 + 7:
case VKEY_F1 + 8:
case VKEY_F1 + 9:
case VKEY_F1 + 10:
case VKEY_F1 + 11:
case VKEY_F1 + 12:
case VKEY_F1 + 13:
case VKEY_F1 + 14:
case VKEY_F1 + 15:
case VKEY_F1 + 16:
case VKEY_F1 + 17:
case VKEY_F1 + 18:
case VKEY_F1 + 19:
case VKEY_F1 + 20:
case VKEY_F1 + 21:
case VKEY_F1 + 22:
case VKEY_F1 + 23:
return 67 + (keysym - VKEY_F1);
case VKEY_LSHIFT:
return 50;
case VKEY_RSHIFT:
return 62;
case VKEY_LCONTROL:
return 37;
case VKEY_RCONTROL:
return 105;
case VKEY_LMENU:
return 64;
case VKEY_RMENU:
return 108;
case VKEY_NUMLOCK:
return 77;
default:
return 0;
}
#else
return keysym - keysym;
#endif
}
}