modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUiKeyboardMap.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an ”AS IS” BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18 * @file     FUiKeyboardMap.cpp
19 * @brief        This is the implementation for the KeyboardMap class.
20 * @version      2.0
21 */
22 // includes
23 #include <FUiKeyboardMap.h>
24 #include <FBaseErrorDefine.h>
25 #include <FBaseSysLog.h>
26 #include <pthread.h>
27
28 // using namespace
29 using namespace Tizen::Base;
30
31 namespace Tizen { namespace Ui
32 {
33
34 enum KeyboardMapType
35 {
36         KEYBOARD_MAP_NONE, // Default
37         KEYBOARD_MAP_GLB, // Global
38         KEYBOARD_MAP_EUR, // Europe
39         KEYBOARD_MAP_ARB, // Arabic
40         KEYBOARD_MAP_CHN, // China
41         KEYBOARD_MAP_ESP, // Spain
42         KEYBOARD_MAP_DEU, // Germany
43         KEYBOARD_MAP_FRA, // France
44         KEYBOARD_MAP_ZAF, // Africa
45         KEYBOARD_MAP_GRC, // Greece
46         KEYBOARD_MAP_IRN, // Iran
47         KEYBOARD_MAP_ITA, // Italy
48         KEYBOARD_MAP_NOR, // Nordic
49         KEYBOARD_MAP_PAK, // Pakistan
50         KEYBOARD_MAP_PRT, // Portugal
51         KEYBOARD_MAP_RUS, // Russia
52         KEYBOARD_MAP_SGP, // Singapore
53         KEYBOARD_MAP_THA, // Thailand
54         KEYBOARD_MAP_VNM, // Vietnam
55         KEYBOARD_MAP_MAX
56 };
57 /*
58 static const wchar_t KEYBOARD_MAP_NONE_NAME[] = L"NONE";
59 static const wchar_t KEYBOARD_MAP_GLB_NAME[] = L"QWERTY_11x4_GLOBAL";
60 static const wchar_t KEYBOARD_MAP_EUR_NAME[] = L"QWERTY_11x4_EUROPE";
61 static const wchar_t KEYBOARD_MAP_ARB_NAME[] = L"QWERTY_11x4_ARAB";
62 static const wchar_t KEYBOARD_MAP_CHN_NAME[] = L"QWERTY_11x4_CHINA";
63 static const wchar_t KEYBOARD_MAP_ESP_NAME[] = L"QWERTY_11x4_SPAIN";
64 static const wchar_t KEYBOARD_MAP_DEU_NAME[] = L"QWERTY_11x4_GERMAN";
65 static const wchar_t KEYBOARD_MAP_FRA_NAME[] = L"QWERTY_11x4_FRENCH";
66 static const wchar_t KEYBOARD_MAP_GRC_NAME[] = L"QWERTY_11x4_GREECE";
67 static const wchar_t KEYBOARD_MAP_IRN_NAME[] = L"QWERTY_11x4_IRAN";
68 static const wchar_t KEYBOARD_MAP_ITA_NAME[] = L"QWERTY_11x4_ITALY";
69 static const wchar_t KEYBOARD_MAP_NOR_NAME[] = L"QWERTY_11x4_NORDIC";
70 static const wchar_t KEYBOARD_MAP_PAK_NAME[] = L"QWERTY_11x4_PAKISTAN";
71 static const wchar_t KEYBOARD_MAP_PRT_NAME[] = L"QWERTY_11x4_PORTUGUESE";
72 static const wchar_t KEYBOARD_MAP_RUS_NAME[] = L"QWERTY_11x4_RUSSIAN";
73 static const wchar_t KEYBOARD_MAP_SGP_NAME[] = L"QWERTY_11x4_SINGAPORE";
74 static const wchar_t KEYBOARD_MAP_THA_NAME[] = L"QWERTY_11x4_THAILAND";
75 static const wchar_t KEYBOARD_MAP_VNM_NAME[] = L"QWERTY_11x4_VIETNAM";
76
77 typedef struct
78 {
79         wchar_t country[20];
80         KeyboardMapType type;
81 } KeyboardMapFileEntry;
82
83
84 static const int KEYBOARD_MAP_TYPE_MAX = 74;
85
86 static KeyboardMapFileEntry gKeyboardMapTypes[KEYBOARD_MAP_TYPE_MAX] =
87 {
88         { L"UK", KEYBOARD_MAP_EUR    },             //NV_OPERATOR_COUNTRY_UK,
89         { L"CHINA", KEYBOARD_MAP_CHN    },          //NV_OPERATOR_COUNTRY_CHINA,
90         { L"FRANCE", KEYBOARD_MAP_FRA    },         //NV_OPERATOR_COUNTRY_FRANCE
91         { L"BELGIUM", KEYBOARD_MAP_FRA    },        //NV_OPERATOR_COUNTRY_BELGIUM
92         { L"GERMANY", KEYBOARD_MAP_DEU    },        //NV_OPERATOR_COUNTRY_GERMANY,
93         { L"AUSTRIA", KEYBOARD_MAP_DEU    },        //NV_OPERATOR_COUNTRY_AUSTRIA
94         { L"GREECE", KEYBOARD_MAP_GRC    },         //NV_OPERATOR_COUNTRY_GREECE,
95         { L"HUNGARY", KEYBOARD_MAP_EUR    },        //NV_OPERATOR_COUNTRY_HUNGARY
96         { L"ITALY", KEYBOARD_MAP_ITA    },          //NV_OPERATOR_COUNTRY_ITALY
97         { L"PORTUGAL", KEYBOARD_MAP_PRT    },       //NV_OPERATOR_COUNTRY_PORTUGAL,
98         { L"SPAIN", KEYBOARD_MAP_ESP    },          //NV_OPERATOR_COUNTRY_SPAIN,
99         { L"ROMANIA", KEYBOARD_MAP_EUR    },        //NV_OPERATOR_COUNTRY_ROMANIA,
100         { L"RUSSIA", KEYBOARD_MAP_RUS    },         //NV_OPERATOR_COUNTRY_RUSSIA,            // Russia
101         { L"UKRAINE", KEYBOARD_MAP_RUS    },        //NV_OPERATOR_COUNTRY_UKRAINE,           // Russia
102         { L"KAZAKHSTAN", KEYBOARD_MAP_RUS    },     //NV_OPERATOR_COUNTRY_KAZAKHSTAN,    // Russia
103         { L"LATVIA", KEYBOARD_MAP_RUS    },         //NV_OPERATOR_COUNTRY_LATVIA,            // Russia
104         { L"ESTONIA", KEYBOARD_MAP_RUS    },        //NV_OPERATOR_COUNTRY_ESTONIA,           // Russia
105         { L"LITHUANIA", KEYBOARD_MAP_RUS    },      //NV_OPERATOR_COUNTRY_LITHUANIA,     // Russia
106         { L"ARMENIA", KEYBOARD_MAP_RUS    },        //NV_OPERATOR_COUNTRY_ARMENIA,           // Russia
107         { L"MOLDOVA", KEYBOARD_MAP_RUS    },        //NV_OPERATOR_COUNTRY_MOLDOVA,           // Russia
108         { L"UZBEKISTAN", KEYBOARD_MAP_RUS    },     //NV_OPERATOR_COUNTRY_UZBEKISTAN,    // Russia
109         { L"TURKEY", KEYBOARD_MAP_GLB    },         //NV_OPERATOR_COUNTRY_TURKEY,               },
110         { L"FINLAND", KEYBOARD_MAP_NOR    },        //NV_OPERATOR_COUNTRY_FINLAND,           // nordic
111         { L"SWEDEN", KEYBOARD_MAP_NOR    },         //NV_OPERATOR_COUNTRY_SWEDEN,            // nordic
112         { L"DENMARK", KEYBOARD_MAP_NOR    },        //NV_OPERATOR_COUNTRY_DENMARK,           // nordic
113         { L"NORWAY", KEYBOARD_MAP_NOR    },         //NV_OPERATOR_COUNTRY_NORWAY,            // nordic
114         { L"VIETNAM", KEYBOARD_MAP_VNM    },        //NV_OPERATOR_COUNTRY_VIETNAM,
115         { L"THAILAND", KEYBOARD_MAP_THA    },       //NV_OPERATOR_COUNTRY_THAILAND,
116         { L"SINGAPORE", KEYBOARD_MAP_SGP    },      //NV_OPERATOR_COUNTRY_SINGAPORE,
117         { L"PAKISTAN", KEYBOARD_MAP_PAK    },       //NV_OPERATOR_COUNTRY_PAKISTAN,
118         { L"ARAB", KEYBOARD_MAP_ARB    },           //NV_OPERATOR_COUNTRY_ARAB,
119         { L"IRAN", KEYBOARD_MAP_IRN    },           //NV_OPERATOR_COUNTRY_IRAN,
120         { L"AUSTRALIA", KEYBOARD_MAP_GLB    },      //NV_OPERATOR_COUNTRY_AUSTRALIA
121         { L"CROATIA", KEYBOARD_MAP_EUR    },        //NV_OPERATOR_COUNTRY_CROATIA,
122         { L"CZECHO", KEYBOARD_MAP_EUR    },         //NV_OPERATOR_COUNTRY_CZECHO,
123         { L"IRELANDS", KEYBOARD_MAP_EUR    },       //NV_OPERATOR_COUNTRY_IRELANDS,
124         { L"ISRAEL", KEYBOARD_MAP_GLB    },         //NV_OPERATOR_COUNTRY_ISRAEL,
125         { L"JAPAN", KEYBOARD_MAP_GLB    },          //NV_OPERATOR_COUNTRY_JAPAN,
126         { L"KOREA", KEYBOARD_MAP_EUR    },          //NV_OPERATOR_COUNTRY_KOREA,                for simulator
127         { L"MALTA", KEYBOARD_MAP_EUR    },          //NV_OPERATOR_COUNTRY_MALTA,
128         { L"NETHERLANDS", KEYBOARD_MAP_EUR    },    //NV_OPERATOR_COUNTRY_NETHERLANDS,
129         { L"NEWZEALAND", KEYBOARD_MAP_GLB    },     //NV_OPERATOR_COUNTRY_NEWZEALAND,
130         { L"POLAND", KEYBOARD_MAP_EUR    },         //NV_OPERATOR_COUNTRY_POLAND,
131         { L"SLOVENIA", KEYBOARD_MAP_EUR    },       //NV_OPERATOR_COUNTRY_SLOVENIA,
132         { L"SOUTHAFRICA", KEYBOARD_MAP_ZAF    },    //NV_OPERATOR_COUNTRY_SOUTHAFRICA,
133         { L"SWISS", KEYBOARD_MAP_EUR    },          //NV_OPERATOR_COUNTRY_SWISS,
134         { L"US", KEYBOARD_MAP_GLB    },             //NV_OPERATOR_COUNTRY_US,
135         { L"SERBIA", KEYBOARD_MAP_EUR    },         //NV_OPERATOR_COUNTRY_SERBIA,
136         { L"ALBANIA", KEYBOARD_MAP_EUR    },        //NV_OPERATOR_COUNTRY_ALBANIA,
137         { L"SLOVAKIA", KEYBOARD_MAP_EUR    },       //NV_OPERATOR_COUNTRY_SLOVAKIA,
138         { L"MACEDONIA", KEYBOARD_MAP_EUR    },      //NV_OPERATOR_COUNTRY_MACEDONIA,
139         { L"BULGARIA", KEYBOARD_MAP_EUR    },       //NV_OPERATOR_COUNTRY_BULGARIA,
140         { L"BALTIC", KEYBOARD_MAP_EUR    },         //NV_OPERATOR_COUNTRY_BALTIC,
141         { L"MALAYSIA", KEYBOARD_MAP_GLB    },       //NV_OPERATOR_COUNTRY_MALAYSIA,
142         { L"ICELAND", KEYBOARD_MAP_EUR    },        //NV_OPERATOR_COUNTRY_ICELAND,
143         { L"CYPRUS", KEYBOARD_MAP_GLB    },         //NV_OPERATOR_COUNTRY_CYPRUS,
144         { L"QATAR", KEYBOARD_MAP_GLB    },          //NV_OPERATOR_COUNTRY_QATAR,
145         { L"PHILIPPINES", KEYBOARD_MAP_GLB    },    //NV_OPERATOR_COUNTRY_PHILIPPINES
146         { L"HONGKONG", KEYBOARD_MAP_GLB    },       //NV_OPERATOR_COUNTRY_HONGKONG,
147         { L"TAIWAN", KEYBOARD_MAP_GLB    },         //NV_OPERATOR_COUNTRY_TAIWAN,
148         { L"INDIA", KEYBOARD_MAP_GLB    },          //NV_OPERATOR_COUNTRY_INDIA,
149         { L"LEBANON", KEYBOARD_MAP_GLB    },        //NV_OPERATOR_COUNTRY_LEBANON,
150         { L"OMAN", KEYBOARD_MAP_GLB    },           //NV_OPERATOR_COUNTRY_OMAN,
151         { L"MAURITIUS", KEYBOARD_MAP_GLB    },      //NV_OPERATOR_COUNTRY_MAURITIUS,
152         { L"KUWAIT", KEYBOARD_MAP_GLB    },         //NV_OPERATOR_COUNTRY_KUWAIT,
153         { L"SYRIA", KEYBOARD_MAP_GLB    },          //NV_OPERATOR_COUNTRY_SYRIA,
154         { L"MOROCCO", KEYBOARD_MAP_ZAF    },        //NV_OPERATOR_COUNTRY_MOROCCO,
155         { L"LUXEMBOURG", KEYBOARD_MAP_EUR    },     //NV_OPERATOR_COUNTRY_LUXEMBOURG,
156         { L"MONTENEGRO", KEYBOARD_MAP_EUR    },     //NV_OPERATOR_COUNTRY_MONTENEGRO,
157         { L"ALGERIA", KEYBOARD_MAP_ZAF    },        //NV_OPERATOR_COUNTRY_ALGERIA,
158         { L"BOSNIA", KEYBOARD_MAP_EUR    },         //NV_OPERATOR_COUNTRY_BOSNIA,
159         { L"INDONESIA", KEYBOARD_MAP_GLB    },      //NV_OPERATOR_COUNTRY_INDONESIA,
160         { L"EGYPT", KEYBOARD_MAP_GLB    },          //NV_OPERATOR_COUNTRY_EGYPT
161         { L"TUNISIA", KEYBOARD_MAP_ZAF    }         //NV_OPERATOR_COUNTRY_TUNISIA,
162 };
163
164 static const int KEYBOARD_TEXT_LEN_MAX = 10;
165
166 typedef struct
167 {
168         int keyCode;
169         int systemKeyCode;
170         bool available;
171         wchar_t label1[KEYBOARD_TEXT_LEN_MAX + 1];           // including null character
172         wchar_t label2[KEYBOARD_TEXT_LEN_MAX + 1];           // including null character
173         wchar_t label3[KEYBOARD_TEXT_LEN_MAX + 1];           // including null character
174         wchar_t label4[KEYBOARD_TEXT_LEN_MAX + 1];           // including null character
175 } KeyboardMapEntry;
176
177
178 static KeyboardMapEntry gKeyboardMapNONE [KEY_HARDWARE_MAX + 1] =
179 {
180     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
181     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
182     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
183     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
184     { KEY_CLEAR,                VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
185     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
186     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
187     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
188     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
189     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
190     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
191     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
192     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
193     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
194     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
195     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
196     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
197     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
198     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
199     { KEY_LEFT,                 VK_HP_LEFT,                 false, L"", L"", L"", L"" },
200     { KEY_UP,                   VK_HP_UP,                   false, L"", L"", L"", L"" },
201     { KEY_DOWN,                 VK_HP_DOWN,                 false, L"", L"", L"", L"" },
202     { KEY_RIGHT,                VK_HP_RIGHT,                false, L"", L"", L"", L"" },
203     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
204     { KEY_A,                    VK_HP_A,                    false, L"A", L"", L"", L"" },
205     { KEY_B,                    VK_HP_B,                    false, L"B", L"", L"", L"" },
206     { KEY_C,                    VK_HP_C,                    false, L"C", L"", L"", L"" },
207     { KEY_D,                    VK_HP_SHARP,                false, L"D", L"", L"", L"" },
208     { KEY_E,                    VK_HP_3,                    false, L"E", L"", L"", L"" },
209     { KEY_F,                    VK_HP_F,                    false, L"F", L"", L"", L"" },
210     { KEY_G,                    VK_HP_G,                    false, L"G", L"", L"", L"" },
211     { KEY_H,                    VK_HP_H,                    false, L"H", L"", L"", L"" },
212     { KEY_I,                    VK_HP_8,                    false, L"I", L"", L"", L"" },
213     { KEY_J,                    VK_HP_J,                    false, L"J", L"", L"", L"" },
214     { KEY_K,                    VK_HP_ASTERISK,             false, L"K", L"", L"", L"" },
215     { KEY_L,                    VK_HP_L,                    false, L"L", L"", L"", L"" },
216     { KEY_M,                    VK_HP_M,                    false, L"M", L"", L"", L"" },
217     { KEY_N,                    VK_HP_N,                    false, L"N", L"", L"", L"" },
218     { KEY_O,                    VK_HP_9,                    false, L"O", L"", L"", L"" },
219     { KEY_P,                    VK_HP_0,                    false, L"P", L"", L"", L"" },
220     { KEY_Q,                    VK_HP_1,                    false, L"Q", L"", L"", L"" },
221     { KEY_R,                    VK_HP_4,                    false, L"R", L"", L"", L"" },
222     { KEY_S,                    VK_HP_S,                    false, L"S", L"", L"", L"" },
223     { KEY_T,                    VK_HP_5,                    false, L"T", L"", L"", L"" },
224     { KEY_U,                    VK_HP_7,                    false, L"U", L"", L"", L"" },
225     { KEY_V,                    VK_HP_V,                    false, L"V", L"", L"", L"" },
226     { KEY_W,                    VK_HP_2,                    false, L"W", L"", L"", L"" },
227     { KEY_Y,                    VK_HP_6,                    false, L"Y", L"", L"", L"" },
228     { KEY_X,                    VK_HP_X,                    false, L"X", L"", L"", L"" },
229     { KEY_Z,                    VK_HP_PLUS,                 false, L"Z", L"", L"", L"" },
230     { KEY_BACKSPACE,            VK_HP_CLEAR,                false, L"", L"", L"", L"" },
231     { KEY_COMMA,                VK_HP_COMMA,                false, L",", L"", L"", L"" },
232     { KEY_ENTER,                VK_HP_ENTER,                false, L"", L"", L"", L"" },
233     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             false, L"", L"", L"", L"" },
234     { KEY_QUESTION,             VK_HP_QUESTION,             false, L"?", L"", L"", L"" },
235     { KEY_ALT,                  VK_HP_FN,                   false, L"", L"", L"", L"" },
236     { KEY_SYM,                  VK_HP_SYM,                  false, L"", L"", L"", L"" },
237     { KEY_SETTING,              VK_HP_INVALID,              false, L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
238     { KEY_SPACE,                VK_HP_SPACE,                false, L" ", L"", L"", L"" },
239     { KEY_DOT,                  VK_HP_POINT,                false, L".", L"", L"", L"" },
240     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
241     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
242     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
243     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
244     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
245     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
246     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
247     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
248     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
249     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
250     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
251     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
252     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
253     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
254     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
255     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
256     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
257     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
258     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
259     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
260     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
261     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
262     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
263 };
264
265 static KeyboardMapEntry gKeyboardMapGLB [KEY_HARDWARE_MAX + 1] =
266 {
267     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
268     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
269     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
270     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
271     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
272     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
273     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
274     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
275     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
276     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
277     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
278     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
279     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
280     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
281     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
282     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
283     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
284     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
285     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
286     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
287     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
288     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
289     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
290     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
291     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
292     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
293     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
294     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
295     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
296     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
297     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"", L"" },
298     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"", L"" },
299     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
300     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
301     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
302     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
303     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
304     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
305     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
306     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
307     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
308     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
309     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
310     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
311     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
312     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
313     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
314     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
315     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
316     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
317     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
318     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
319     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
320     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
321     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
322     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
323     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
324     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
325     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
326     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
327     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
328     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
329     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
330     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
331     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
332     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
333     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
334     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
335     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
336     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
337     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
338     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
339     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
340     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
341     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
342     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
343     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
344     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
345     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
346     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
347     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
348     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
349     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
350 };
351
352
353 static KeyboardMapEntry gKeyboardMapEUR [KEY_HARDWARE_MAX + 1] =
354 {
355     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
356     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
357     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
358     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
359     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
360     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
361     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
362     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
363     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
364     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
365     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
366     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
367     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
368     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
369     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
370     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
371     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
372     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
373     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
374     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
375     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
376     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
377     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
378     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
379     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
380     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
381     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
382     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
383     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
384     { KEY_F,                    VK_HP_F,                    true,  L"F", L"\u00A3", L"", L"" },
385     { KEY_G,                    VK_HP_G,                    true,  L"G", L"$", L"", L"" },
386     { KEY_H,                    VK_HP_H,                    true,  L"H", L"\u20AC", L"", L"" },
387     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
388     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
389     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
390     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
391     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
392     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
393     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
394     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
395     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
396     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
397     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
398     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
399     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
400     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
401     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
402     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
403     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
404     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
405     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
406     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
407     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
408     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
409     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
410     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
411     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
412     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
413     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
414     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
415     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
416     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
417     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
418     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
419     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
420     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
421     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
422     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
423     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
424     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
425     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
426     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
427     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
428     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
429     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
430     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
431     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
432     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
433     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
434     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
435     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
436     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
437     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
438 };
439
440 static KeyboardMapEntry gKeyboardMapCHN [KEY_HARDWARE_MAX + 1] =
441 {
442     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
443     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
444     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
445     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
446     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
447     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
448     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
449     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
450     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
451     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
452     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
453     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
454     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
455     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
456     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
457     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
458     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
459     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
460     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
461     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
462     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
463     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
464     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
465     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
466     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
467     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
468     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
469     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
470     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
471     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
472     { KEY_G,                    VK_HP_G,                    true,  L"G", L"\u00A5", L"", L"" },
473     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"", L"" },
474     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
475     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
476     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
477     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
478     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
479     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
480     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
481     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
482     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
483     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
484     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
485     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
486     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
487     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
488     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
489     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
490     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
491     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
492     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
493     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
494     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
495     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
496     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
497     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
498     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
499     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
500     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
501     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
502     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
503     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
504     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
505     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
506     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
507     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
508     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
509     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
510     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
511     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
512     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
513     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
514     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
515     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
516     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
517     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
518     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
519     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
520     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
521     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
522     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
523     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
524     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
525 };
526
527 static KeyboardMapEntry gKeyboardMapESP [KEY_HARDWARE_MAX + 1] =
528 {
529     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
530     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
531     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
532     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
533     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
534     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
535     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
536     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
537     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
538     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
539     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
540     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
541     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
542     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
543     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
544     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
545     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
546     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
547     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
548     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
549     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
550     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
551     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
552     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
553     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
554     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
555     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
556     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
557     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
558     { KEY_F,                    VK_HP_F,                    true,  L"F", L"\u20AC", L"", L"" },
559     { KEY_G,                    VK_HP_G,                    true,  L"G", L"$", L"", L"" },
560     { KEY_H,                    VK_HP_H,                    true,  L"H", L"\00A1", L"", L"" },
561     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
562     { KEY_J,                    VK_HP_J,                    true,  L"J", L"\u00BF", L"", L"" },
563     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
564     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
565     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
566     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
567     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
568     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
569     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
570     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
571     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
572     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
573     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
574     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
575     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
576     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
577     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
578     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
579     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
580     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
581     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
582     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
583     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
584     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
585     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
586     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
587     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
588     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
589     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
590     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
591     { KEY_CHAR_SYM_1,           VK_HP_COMMA,                true,  L"\00D1", L")", L"\00E7", L"" },
592     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
593     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
594     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
595     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
596     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
597     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
598     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
599     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
600     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
601     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
602     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
603     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
604     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
605     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
606     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
607     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
608     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
609     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
610     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
611     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
612 };
613
614 static KeyboardMapEntry gKeyboardMapDEU [KEY_HARDWARE_MAX + 1] =
615 {
616     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
617     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
618     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
619     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
620     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
621     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
622     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
623     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
624     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
625     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
626     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
627     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
628     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
629     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
630     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
631     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
632     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
633     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
634     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
635     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
636     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
637     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
638     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
639     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
640     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
641     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
642     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
643     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
644     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
645     { KEY_F,                    VK_HP_F,                    true,  L"F", L"\u20AC", L"", L"" },
646     { KEY_G,                    VK_HP_G,                    true,  L"G", L"$", L"", L"" },
647     { KEY_H,                    VK_HP_H,                    true,  L"H", L"%", L"", L"" },
648     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
649     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
650     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
651     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
652     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
653     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
654     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
655     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
656     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
657     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
658     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
659     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
660     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
661     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
662     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
663     { KEY_Y,                    VK_HP_PLUS,                 true,  L"Y", L"+", L"", L"" },
664     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
665     { KEY_Z,                    VK_HP_6,                    true,  L"Z", L"6", L"", L"" },
666     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
667     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
668     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
669     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
670     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
671     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
672     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
673     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
674     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
675     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
676     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
677     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
678     { KEY_CHAR_SYM_1,           VK_HP_COMMA,                true,  L"\u00DF", L")", L"", L"" },
679     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
680     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
681     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
682     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
683     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
684     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
685     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
686     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
687     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
688     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
689     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
690     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
691     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
692     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
693     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
694     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
695     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
696     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
697     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
698     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
699 };
700
701 static KeyboardMapEntry gKeyboardMapFRA [KEY_HARDWARE_MAX + 1] =
702 {
703     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
704     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
705     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
706     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
707     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
708     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
709     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
710     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
711     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
712     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
713     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
714     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
715     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
716     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
717     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
718     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
719     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
720     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
721     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
722     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
723     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
724     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
725     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
726     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
727     { KEY_A,                    VK_HP_1,                    true,  L"A", L"1", L"", L"" },
728     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
729     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
730     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
731     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
732     { KEY_F,                    VK_HP_F,                    true,  L"F", L"\u20AC", L"", L"" },
733     { KEY_G,                    VK_HP_G,                    true,  L"G", L"$", L"", L"" },
734     { KEY_H,                    VK_HP_H,                    true,  L"H", L"%", L"", L"" },
735     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
736     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
737     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
738     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
739     { KEY_M,                    VK_HP_COMMA,                true,  L"M", L")", L"", L"" },
740     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
741     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
742     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
743     { KEY_Q,                    VK_HP_A,                    true,  L"Q", L"!", L"", L"" },
744     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
745     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
746     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
747     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
748     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
749     { KEY_W,                    VK_HP_PLUS,                 true,  L"W", L"+", L"", L"" },
750     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
751     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
752     { KEY_Z,                    VK_HP_2,                    true,  L"Z", L"2", L"", L"" },
753     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
754     { KEY_COMMA,                VK_HP_M,                    true,  L",", L"'", L"", L"" },
755     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
756     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
757     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
758     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
759     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
760     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
761     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
762     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
763     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
764     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
765     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
766     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
767     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
768     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
769     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
770     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
771     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
772     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
773     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
774     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
775     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
776     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
777     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
778     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
779     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
780     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
781     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
782     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
783     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
784     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
785     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
786 };
787
788 static KeyboardMapEntry gKeyboardMapZAF [KEY_HARDWARE_MAX + 1] =
789 {
790     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
791     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
792     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
793     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
794     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
795     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
796     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
797     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
798     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
799     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
800     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
801     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
802     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
803     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
804     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
805     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
806     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
807     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
808     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
809     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
810     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
811     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
812     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
813     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
814     { KEY_A,                    VK_HP_1,                    true,  L"A", L"1", L"", L"" },
815     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
816     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
817     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
818     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
819     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
820     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"", L"" },
821     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"", L"" },
822     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
823     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
824     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
825     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
826     { KEY_M,                    VK_HP_COMMA,                true,  L"M", L")", L"", L"" },
827     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
828     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
829     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
830     { KEY_Q,                    VK_HP_A,                    true,  L"Q", L"!", L"", L"" },
831     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
832     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
833     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
834     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
835     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
836     { KEY_W,                    VK_HP_PLUS,                 true,  L"W", L"+", L"", L"" },
837     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
838     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
839     { KEY_Z,                    VK_HP_2,                    true,  L"Z", L"2", L"", L"" },
840     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
841     { KEY_COMMA,                VK_HP_M,                    true,  L",", L"'", L"", L"" },
842     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
843     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
844     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
845     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
846     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
847     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
848     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
849     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
850     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
851     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
852     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
853     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
854     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
855     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
856     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
857     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
858     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
859     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
860     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
861     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
862     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
863     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
864     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
865     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
866     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
867     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
868     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
869     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
870     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
871     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
872     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
873 };
874
875 static KeyboardMapEntry gKeyboardMapGRC [KEY_HARDWARE_MAX + 1] =
876 {
877     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
878     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
879     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
880     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
881     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
882     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
883     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
884     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
885     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
886     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
887     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
888     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
889     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
890     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
891     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
892     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
893     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
894     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
895     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
896     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
897     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
898     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
899     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
900     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
901     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
902     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
903     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u03C8", L"" },
904     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u0394", L"" },
905     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
906     { KEY_F,                    VK_HP_F,                    true,  L"F", L"\u20AC", L"\u03A6", L"" },
907     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"\u0393", L"" },
908     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"", L"" },
909     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
910     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u039E", L"" },
911     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
912     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u039B", L"" },
913     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
914     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
915     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
916     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u03A0", L"" },
917     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
918     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u03A1", L"" },
919     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u03A3", L"" },
920     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
921     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u0398", L"" },
922     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
923     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u03C2", L"" },
924     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
925     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
926     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
927     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
928     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
929     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
930     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
931     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
932     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
933     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
934     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
935     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
936     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
937     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
938     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
939     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
940     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
941     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
942     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
943     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
944     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
945     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
946     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
947     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
948     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
949     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
950     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
951     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
952     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
953     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
954     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
955     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
956     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
957     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
958     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
959     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
960 };
961
962 static KeyboardMapEntry gKeyboardMapEUR_2 [KEY_HARDWARE_MAX + 1] = // ITALY/PORTUGAL
963 {
964     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
965     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
966     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
967     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
968     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
969     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
970     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
971     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
972     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
973     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
974     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
975     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
976     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
977     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
978     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
979     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
980     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
981     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
982     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
983     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
984     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
985     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
986     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
987     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
988     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
989     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
990     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
991     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
992     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
993     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
994     { KEY_G,                    VK_HP_G,                    true,  L"G", L"\u20AC", L"", L"" },
995     { KEY_H,                    VK_HP_H,                    true,  L"H", L"%", L"", L"" },
996     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
997     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
998     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
999     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
1000     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
1001     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
1002     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
1003     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
1004     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
1005     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
1006     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
1007     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
1008     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
1009     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
1010     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
1011     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
1012     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
1013     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
1014     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1015     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
1016     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1017     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1018     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
1019     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1020     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1021     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1022     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1023     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
1024     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1025     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1026     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
1027     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1028     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1029     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1030     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1031     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1032     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1033     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1034     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1035     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1036     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1037     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1038     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1039     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1040     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1041     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1042     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1043     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1044     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1045     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1046     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1047 };
1048
1049 static KeyboardMapEntry gKeyboardMapRUS [KEY_HARDWARE_MAX + 1] =
1050 {
1051     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1052     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1053     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1054     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1055     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1056     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1057     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1058     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1059     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1060     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1061     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1062     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1063     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1064     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1065     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1066     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1067     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1068     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1069     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1070     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1071     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1072     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1073     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1074     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1075     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0424", L"" },
1076     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"\u0418", L"" },
1077     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u0421", L"" },
1078     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u0412", L"" },
1079     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u0423", L"" },
1080     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"\u0410", L"" },
1081     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"\u041F", L"" },
1082     { KEY_H,                    VK_HP_H,                    true,  L"H", L"/", L"\u0420", L"" },
1083     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"\u0428", L"\u0429" },
1084     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u041E", L"" },
1085     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"\u041B", L"" },
1086     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u0414", L"" },
1087     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"\u042C", L"\u0411"},
1088     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"\u0422", L"" },
1089     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u0417", L"" },
1090     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u0425", L"\u042A"},
1091     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"\u0419", L"" },
1092     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u041A", L"" },
1093     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u042B", L"" },
1094     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"\u0415", L"\u0401" },
1095     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u0413", L"" },
1096     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"\u041C", L"" },
1097     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u0426", L"" },
1098     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"\u041D", L"" },
1099     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"\u0427", L"" },
1100     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"\u042F", L"" },
1101     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1102     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1103     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1104     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1105     { KEY_QUESTION,             VK_HP_INVALID,              false, L"", L"", L"", L"" },
1106     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1107     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1108     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1109     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1110     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
1111     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1112     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1113     { KEY_CHAR_SYM_1,           VK_HP_COMMA,                true,  L"\u0416", L")", L"\u042D", L"" },
1114     { KEY_CHAR_SYM_2,           VK_HP_QUESTION,             true,  L"\u042E", L"?", L"", L"" },
1115     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1116     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1117     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1118     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1119     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1120     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1121     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1122     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1123     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1124     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1125     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1126     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1127     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1128     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1129     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1130     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1131     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1132     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1133     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1134 };
1135
1136 static KeyboardMapEntry gKeyboardMapNOR [KEY_HARDWARE_MAX + 1] =
1137 {
1138     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1139     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1140     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1141     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1142     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1143     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1144     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1145     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1146     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1147     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1148     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1149     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1150     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1151     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1152     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1153     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1154     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1155     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1156     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1157     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1158     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1159     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1160     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1161     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1162     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"", L"" },
1163     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
1164     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
1165     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"", L"" },
1166     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"", L"" },
1167     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
1168     { KEY_G,                    VK_HP_G,                    true,  L"G", L"\u20AC", L"", L"" },
1169     { KEY_H,                    VK_HP_H,                    true,  L"H", L"%", L"", L"" },
1170     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
1171     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
1172     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
1173     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
1174     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
1175     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
1176     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"", L"" },
1177     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
1178     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
1179     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
1180     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
1181     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
1182     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"", L"" },
1183     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
1184     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
1185     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
1186     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
1187     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
1188     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1189     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1190     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1191     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1192     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L",", L"", L"" },
1193     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1194     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1195     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1196     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1197     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
1198     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1199     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1200     { KEY_CHAR_SYM_1,           VK_HP_COMMA,                true,  L"\u00D6", L")", L"", L"" },
1201     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM1,          true,  L"\u00C4", L"\"", L"\u00C5", L"" },
1202     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1203     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1204     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1205     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1206     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1207     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1208     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1209     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1210     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1211     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1212     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1213     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1214     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1215     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1216     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1217     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1218     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1219     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1220     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1221
1222 };
1223
1224
1225 static KeyboardMapEntry gKeyboardMapARB [KEY_HARDWARE_MAX + 1] =
1226 {
1227     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1228     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1229     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1230     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1231     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1232     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1233     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1234     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1235     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1236     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1237     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1238     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1239     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1240     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1241     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1242     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1243     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1244     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1245     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1246     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1247     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1248     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1249     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1250     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1251     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0634", L"" },
1252     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"\uFEFB", L"\uFEF5" },
1253     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u0624", L"" },
1254     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u064A", L"" },
1255     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u062B", L"" },
1256     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"\u0628", L"" },
1257     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"\u0644", L"" },
1258     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"\u0627", L"\u0623" },
1259     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"\u0647", L"" },
1260     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u062A", L"" },
1261     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"\u0646", L"\u0643" },
1262     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u0645", L"\u0637" },
1263     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"\u0629", L"\u0632" },
1264     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"\u0649", L"\u0622" },
1265     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u062E", L"\u062C" },
1266     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u062D", L"\u062F" },
1267     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"\u0630", L"\u0636" },
1268     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u0642", L"" },
1269     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u0633", L"" },
1270     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"\u0641", L"\uFEF9" },
1271     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u0639", L"" },
1272     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"\u0631", L"" },
1273     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u0635", L"" },
1274     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"\u063A", L"\u0625" },
1275     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"\u0621", L"" },
1276     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"\u0626", L"" },
1277     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1278     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1279     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1280     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1281     { KEY_QUESTION,             VK_HP_COMMA,                true,  L"\u061F", L")", L"", L"" },
1282     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1283     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1284     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1285     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1286     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
1287     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1288     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1289     { KEY_CHAR_SYM_1,           VK_HP_QUESTION,             true,  L"\u0648", L"\"", L"\u0638", L"" },
1290     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1291     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1292     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1293     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1294     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1295     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1296     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1297     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1298     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1299     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1300     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1301     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1302     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1303     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1304     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1305     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1306     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1307     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1308     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1309     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1310
1311 };
1312
1313
1314 static KeyboardMapEntry gKeyboardMapIRN [KEY_HARDWARE_MAX + 1] =
1315 {
1316     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1317     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1318     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1319     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1320     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1321     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1322     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1323     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1324     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1325     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1326     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1327     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1328     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1329     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1330     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1331     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1332     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1333     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1334     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1335     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1336     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1337     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1338     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1339     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1340     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0634", L"" },
1341     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"\u062F", L"" },
1342     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u0631", L"" },
1343     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u0649", L"" },
1344     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u0642", L"" },
1345     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"\u0628", L"" },
1346     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"\u0644", L"" },
1347     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"\u0627", L"\u0622" },
1348     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"\u062D", L"" },
1349     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u062A", L"" },
1350     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"\u0646", L"" },
1351     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u0645", L"" },
1352     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"\u06A9", L"" },
1353     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"\u0648", L"" },
1354     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u062C", L"\u0686" },
1355     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u067E", L"" },
1356     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"\u0635", L"\u0636" },
1357     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u0641", L"" },
1358     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u0633", L"" },
1359     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"\u0639", L"\u063A" },
1360     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u062E", L"" },
1361     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"\u0630", L"" },
1362     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u062B", L"" },
1363     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"\u0647", L"" },
1364     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"\u0632", L"\u0698" },
1365     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"\u0637", L"\u0638" },
1366     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1367     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1368     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1369     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1370     { KEY_QUESTION,             VK_HP_COMMA,                true,  L"\u061F", L")", L"", L"" },
1371     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1372     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1373     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1374     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1375     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
1376     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1377     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1378     { KEY_CHAR_SYM_1,           VK_HP_QUESTION,             true,  L"\u06AF", L"\"", L"\u0621", L"" },
1379     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1380     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1381     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1382     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1383     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1384     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1385     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1386     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1387     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1388     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1389     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1390     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1391     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1392     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1393     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1394     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1395     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1396     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1397     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1398     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1399 };
1400
1401 static KeyboardMapEntry gKeyboardMapPAK [KEY_HARDWARE_MAX + 1] =
1402 {
1403     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1404     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1405     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1406     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1407     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1408     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1409     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1410     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1411     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1412     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1413     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1414     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1415     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1416     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1417     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1418     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1419     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1420     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1421     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1422     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1423     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1424     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1425     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1426     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1427     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0627", L"\u0622" },
1428     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"\u0628", L"" },
1429     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u0686", L"\u062B" },
1430     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u062F", L"\u0688" },
1431     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u0639", L"\u0651" },
1432     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"\u0641", L"" },
1433     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"\u06AF", L"\u063A" },
1434     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"\u0647", L"\u062D" },
1435     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"\u0649", L"\u064A" },
1436     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u062C", L"" },
1437     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"\u06A9", L"\u062E" },
1438     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u0644", L"" },
1439     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"\u0645", L"" },
1440     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"\u0646", L"\u06BA" },
1441     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u06D5", L"\u0629" },
1442     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u067F", L"\u064E" },
1443     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"\u0642", L"\u0643" },
1444     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u0631", L"\u0691" },
1445     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u0633", L"\u0634" },
1446     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"\u062A", L"\u0679" },
1447     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u0626", L"\u0621" },
1448     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"\u0637", L"\u0638" },
1449     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u0648", L"\u0676" },
1450     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"\u06D2", L"" },
1451     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"\u0635", L"\u0636" },
1452     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"\u0632", L"\u0630" },
1453     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1454     { KEY_COMMA,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1455     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1456     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1457     { KEY_QUESTION,             VK_HP_COMMA,                true,  L"\u061F", L")", L"", L"" },
1458     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1459     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1460     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1461     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1462     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L",", L"", L"" },
1463     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1464     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1465     { KEY_CHAR_SYM_1,           VK_HP_QUESTION,             true,  L"\u0698", L"\"", L"", L"" },
1466     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1467     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1468     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1469     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1470     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1471     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1472     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1473     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1474     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1475     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1476     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1477     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1478     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1479     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1480     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1481     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1482     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1483     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1484     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1485     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1486 };
1487
1488 static KeyboardMapEntry gKeyboardMapTHA [KEY_HARDWARE_MAX + 1] =
1489 {
1490     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1491     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1492     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1493     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1494     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1495     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1496     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1497     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1498     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1499     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1500     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1501     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1502     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1503     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1504     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1505     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1506     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1507     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1508     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1509     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1510     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1511     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1512     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1513     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1514     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0E1F", L"\u0E2B" },
1515     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"\u0E37", L"\u0E4C" },
1516     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"\u0E2D", L"\u0E09" },
1517     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u0E40", L"\u0E42" },
1518     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u0E1E", L"\u0E46" },
1519     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"\u0E49", L"\u0E47" },
1520     { KEY_G,                    VK_HP_G,                    true,  L"G", L"\u0E3F", L"\u0E48", L"\u0E4B" },
1521     { KEY_H,                    VK_HP_H,                    true,  L"H", L"%", L"\u0E32", L"\u0E4A" },
1522     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"\u0E19", L"\u0E08" },
1523     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"\u0E2A", L"\u0E29" },
1524     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"\u0E27", L"\u0E28" },
1525     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"\u0E07", L"\u0E0B" },
1526     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"\u0E43", L"\u0E2C" },
1527     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"\u0E21", L"\u0E17" },
1528     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u0E22", L"\u0E02" },
1529     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"\u0E1A", L"\u0E0A" },
1530     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"\u0E44", L"\u0E46" },
1531     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"\u0E30", L"\u0E38" },
1532     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"\u0E01", L"\u0E14" },
1533     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"\u0E31", L"\u0E36" },
1534     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u0E23", L"\u0E15" },
1535     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"\u0E34", L"\u0E2E" },
1536     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"\u0E33", L"\u0E11" },
1537     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"\u0E04", L"\u0E35" },
1538     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
1539     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
1540     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1541     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
1542     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1543     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1544     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
1545     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1546     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1547     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1548     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1549     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
1550     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1551     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1552     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_SYM1,          false, L"", L"", L"", L"" },
1553     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1554     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1555     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1556     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1557     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1558     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1559     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1560     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1561     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1562     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1563     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1564     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1565     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1566     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1567     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1568     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1569     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1570     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1571     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1572     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1573 };
1574
1575
1576 static KeyboardMapEntry gKeyboardMapVNM [KEY_HARDWARE_MAX + 1] =
1577 {
1578     { KEY_INVALID,              VK_HP_INVALID,              false, L"", L"", L"", L"" },
1579     { KEY_SIDE_UP,              VK_HP_SIDEUP,               true,  L"", L"", L"", L"" },
1580     { KEY_SIDE_DOWN,            VK_HP_SIDEDOWN,             true,  L"", L"", L"", L"" },
1581     { KEY_OK,                   VK_HP_OK,                   true,  L"OK", L"", L"", L"" },
1582     { KEY_CLEAR,                VK_HP_INVALID,              false, L"", L"", L"", L"" },
1583     { KEY_CAMERA,               VK_HP_CAMERA,               true,  L"", L"", L"", L"" },
1584     { KEY_SWITCH,               VK_HP_SWITCH,               true,  L"", L"", L"", L"" },
1585     { KEY_0,                    VK_HP_INVALID,              false, L"0", L"", L"", L"" },
1586     { KEY_1,                    VK_HP_INVALID,              false, L"1", L"", L"", L"" },
1587     { KEY_2,                    VK_HP_INVALID,              false, L"2", L"", L"", L"" },
1588     { KEY_3,                    VK_HP_INVALID,              false, L"3", L"", L"", L"" },
1589     { KEY_4,                    VK_HP_INVALID,              false, L"4", L"", L"", L"" },
1590     { KEY_5,                    VK_HP_INVALID,              false, L"5", L"", L"", L"" },
1591     { KEY_6,                    VK_HP_INVALID,              false, L"6", L"", L"", L"" },
1592     { KEY_7,                    VK_HP_INVALID,              false, L"7", L"", L"", L"" },
1593     { KEY_8,                    VK_HP_INVALID,              false, L"8", L"", L"", L"" },
1594     { KEY_9,                    VK_HP_INVALID,              false, L"9", L"", L"", L"" },
1595     { KEY_ASTERISK,             VK_HP_INVALID,              false, L"*", L"", L"", L"" },
1596     { KEY_SHARP,                VK_HP_INVALID,              false, L"#", L"", L"", L"" },
1597     { KEY_LEFT,                 VK_HP_LEFT,                 true,  L"", L"", L"", L"" },
1598     { KEY_UP,                   VK_HP_UP,                   true,  L"", L"", L"", L"" },
1599     { KEY_DOWN,                 VK_HP_DOWN,                 true,  L"", L"", L"", L"" },
1600     { KEY_RIGHT,                VK_HP_RIGHT,                true,  L"", L"", L"", L"" },
1601     { KEY_MAX,                  VK_HP_INVALID,              false, L"", L"", L"", L"" },
1602     { KEY_A,                    VK_HP_A,                    true,  L"A", L"!", L"\u0103", L"\u00E2" },
1603     { KEY_B,                    VK_HP_B,                    true,  L"B", L";", L"", L"" },
1604     { KEY_C,                    VK_HP_C,                    true,  L"C", L"_", L"", L"" },
1605     { KEY_D,                    VK_HP_SHARP,                true,  L"D", L"#", L"\u0111", L"" },
1606     { KEY_E,                    VK_HP_3,                    true,  L"E", L"3", L"\u00EA", L"" },
1607     { KEY_F,                    VK_HP_F,                    true,  L"F", L"$", L"", L"" },
1608     { KEY_G,                    VK_HP_G,                    true,  L"G", L"%", L"", L"" },
1609     { KEY_H,                    VK_HP_H,                    true,  L"H", L"^", L"", L"" },
1610     { KEY_I,                    VK_HP_8,                    true,  L"I", L"8", L"", L"" },
1611     { KEY_J,                    VK_HP_J,                    true,  L"J", L"&", L"", L"" },
1612     { KEY_K,                    VK_HP_ASTERISK,             true,  L"K", L"*", L"", L"" },
1613     { KEY_L,                    VK_HP_L,                    true,  L"L", L"(", L"", L"" },
1614     { KEY_M,                    VK_HP_M,                    true,  L"M", L"'", L"", L"" },
1615     { KEY_N,                    VK_HP_N,                    true,  L"N", L":", L"", L"" },
1616     { KEY_O,                    VK_HP_9,                    true,  L"O", L"9", L"\u00F4", L"\u01A1" },
1617     { KEY_P,                    VK_HP_0,                    true,  L"P", L"0", L"", L"" },
1618     { KEY_Q,                    VK_HP_1,                    true,  L"Q", L"1", L"", L"" },
1619     { KEY_R,                    VK_HP_4,                    true,  L"R", L"4", L"", L"" },
1620     { KEY_S,                    VK_HP_S,                    true,  L"S", L"@", L"", L"" },
1621     { KEY_T,                    VK_HP_5,                    true,  L"T", L"5", L"", L"" },
1622     { KEY_U,                    VK_HP_7,                    true,  L"U", L"7", L"\u01B0", L"" },
1623     { KEY_V,                    VK_HP_V,                    true,  L"V", L"/", L"", L"" },
1624     { KEY_W,                    VK_HP_2,                    true,  L"W", L"2", L"", L"" },
1625     { KEY_Y,                    VK_HP_6,                    true,  L"Y", L"6", L"", L"" },
1626     { KEY_X,                    VK_HP_X,                    true,  L"X", L"-", L"", L"" },
1627     { KEY_Z,                    VK_HP_PLUS,                 true,  L"Z", L"+", L"", L"" },
1628     { KEY_BACKSPACE,            VK_HP_CLEAR,                true,  L"", L"", L"", L"" },
1629     { KEY_COMMA,                VK_HP_COMMA,                true,  L",", L")", L"", L"" },
1630     { KEY_ENTER,                VK_HP_ENTER,                true,  L"", L"", L"", L"" },
1631     { KEY_CAPSLOCK,             VK_HP_CAPSLOCK,             true,  L"", L"", L"", L"" },
1632     { KEY_QUESTION,             VK_HP_QUESTION,             true,  L"?", L"\"", L"", L"" },
1633     { KEY_ALT,                  VK_HP_FN,                   true,  L"", L"", L"", L"" },
1634     { KEY_SYM,                  VK_HP_SYM,                  true,  L"sym", L":)", L"", L"" },
1635     { KEY_SETTING,              VK_HP_INVALID,              false,  L"", L"", L"", L"" }, // for wave37 which does not diefine VK_HP_SETTING
1636     { KEY_SPACE,                VK_HP_SPACE,                true,  L" ", L"", L"", L"" },
1637     { KEY_DOT,                  VK_HP_POINT,                true,  L".", L".com", L"", L"" },
1638     { KEY_FN,                   VK_HP_INVALID,              false, L"", L"", L"", L"" },
1639     { KEY_CAMERA_HALF_SHUTTER,  VK_HP_CAMERA_HALF_SHUTTER,  false, L"", L"", L"", L"" },
1640     { KEY_CHAR_SYM_1,           VK_HP_QWERTY_TONE,          true,  L"\u0301", L"\u0300", L"\u0309", L"\u02DC" },
1641     { KEY_CHAR_SYM_2,           VK_HP_QWERTY_SYM2,          false, L"", L"", L"", L"" },
1642     { KEY_CHAR_SYM_3,           VK_HP_QWERTY_SYM3,          false, L"", L"", L"", L"" },
1643     { KEY_CHAR_SYM_4,           VK_HP_QWERTY_SYM4,          false, L"", L"", L"", L"" },
1644     { KEY_CHAR_SYM_5,           VK_HP_QWERTY_SYM5,          false, L"", L"", L"", L"" },
1645     { KEY_CHAR_SYM_6,           VK_HP_QWERTY_SYM6,          false, L"", L"", L"", L"" },
1646     { KEY_CHAR_SYM_7,           VK_HP_QWERTY_SYM7,          false, L"", L"", L"", L"" },
1647     { KEY_CHAR_SYM_8,           VK_HP_QWERTY_SYM8,          false, L"", L"", L"", L"" },
1648     { KEY_CHAR_SYM_9,           VK_HP_QWERTY_SYM9,          false, L"", L"", L"", L"" },
1649     { KEY_CHAR_SYM_A,           VK_HP_QWERTY_SYMA,          false, L"", L"", L"", L"" },
1650     { KEY_CHAR_SYM_B,           VK_HP_QWERTY_SYMB,          false, L"", L"", L"", L"" },
1651     { KEY_CHAR_SYM_C,           VK_HP_QWERTY_SYMC,          false, L"", L"", L"", L"" },
1652     { KEY_CHAR_SYM_D,           VK_HP_QWERTY_SYMD,          false, L"", L"", L"", L"" },
1653     { KEY_CHAR_SYM_E,           VK_HP_QWERTY_SYME,          false, L"", L"", L"", L"" },
1654     { KEY_CHAR_SYM_F,           VK_HP_QWERTY_SYMF,          false, L"", L"", L"", L"" },
1655     { KEY_FN_1,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1656     { KEY_FN_2,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1657     { KEY_FN_3,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1658     { KEY_FN_4,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1659     { KEY_FN_5,                 VK_HP_INVALID,              false, L"", L"", L"", L"" },
1660     { KEY_HARDWARE_MAX,         VK_HP_INVALID,              false, L"", L"", L"", L"" },
1661 };
1662
1663 static KeyboardMapEntry* gKeyboardMap = null;
1664 static wchar_t* gKeyBoardTypeName = null;
1665 */
1666
1667 KeyboardMap* pKeyboardMapInstance = null;
1668
1669 // forward declarations
1670 result LoadKeyboardMap(void);
1671
1672 ////////////////////////////////////////////////////////////////////////////////
1673 /// KeyboardMap class Lifecycle
1674
1675 KeyboardMap::KeyboardMap(void)
1676 {
1677         // NOTHING
1678 }
1679
1680
1681 KeyboardMap::~KeyboardMap(void)
1682 {
1683         // NOTHING
1684 }
1685
1686
1687 result
1688 KeyboardMap::Construct(void)
1689 {
1690         LoadKeyboardMap();
1691         return (E_SUCCESS);
1692 }
1693
1694 KeyboardMap*
1695 KeyboardMap::GetInstance(void)
1696 {
1697         static pthread_once_t once_block = PTHREAD_ONCE_INIT;
1698
1699         pthread_once(&once_block, InitializeInstance);
1700
1701         static bool constructed = false;
1702
1703         if (!constructed)
1704         {
1705                 pKeyboardMapInstance->Construct();
1706                 constructed = true;
1707         }
1708
1709         return pKeyboardMapInstance;
1710 }
1711
1712 void
1713 KeyboardMap::InitializeInstance(void)
1714 {
1715         static KeyboardMap instance;
1716         pKeyboardMapInstance = &instance;
1717
1718 }
1719
1720 ////////////////////////////////////////////////////////////////////////////////
1721 /// KeyboardMap class Operations
1722
1723
1724 KeyCode
1725 KeyboardMap::GetKeyCode(int systemKeyCode) const
1726 {
1727 /*
1728     if (VK_HP_INVALID == systemKeyCode)
1729         return KEY_INVALID;
1730
1731     if (gKeyboardMap == null)
1732         return KEY_INVALID;
1733
1734     for (int i = 0; i < KEY_HARDWARE_MAX; i++)
1735     {
1736         if (gKeyboardMap[i].systemKeyCode == systemKeyCode)
1737             return KeyCode(gKeyboardMap[i].keyCode);
1738     }
1739 */
1740
1741         return KEY_INVALID;
1742 }
1743
1744
1745 bool
1746 KeyboardMap::IsPrintingKey(KeyCode keyCode) const
1747 {
1748 /*
1749     if (gKeyboardMap == null)
1750         return false;
1751
1752     if (gKeyboardMap[keyCode].label1[0] != L'n')
1753         return true;
1754     return false;
1755 */
1756
1757         return false;
1758 }
1759
1760
1761 String
1762 KeyboardMap::GetDisplayableLabel(KeyCode keyCode, KeyboardKeyLabelType type) const
1763 {
1764 /*
1765     String label = L"";
1766
1767     if (gKeyboardMap == null)
1768         return label;
1769
1770     switch (type)
1771     {
1772         case KEYBOARD_KEY_LABEL_1:
1773             if (gKeyboardMap[keyCode].label1[0] == L'n' &&  // L'n' means no label
1774                 gKeyboardMap[keyCode].label1[1] == 0)
1775             {
1776                 label = L"";
1777             }
1778             else
1779             {
1780                 // check for space 's' character
1781                 if (gKeyboardMap[keyCode].label1[0] == L's')
1782                     label = L" "; //space
1783                 else
1784                     label = gKeyboardMap[keyCode].label1;
1785             }
1786             break;
1787         case KEYBOARD_KEY_LABEL_2:
1788             if (gKeyboardMap[keyCode].label2[0] == L'n' && // L'n' means no label
1789                 gKeyboardMap[keyCode].label2[1] == 0)
1790             {
1791                 label = L"";
1792             }
1793             else
1794             {
1795                 // check for space 's' character
1796                 if (gKeyboardMap[keyCode].label2[0] == L's')
1797                     label = L" "; //space
1798                 else
1799                     label = gKeyboardMap[keyCode].label2;
1800             }
1801             break;
1802         case KEYBOARD_KEY_LABEL_3:
1803             if (gKeyboardMap[keyCode].label3[0] == L'n' && // L'n' means no label
1804                 gKeyboardMap[keyCode].label3[1] == 0)
1805             {
1806                 label = L"";
1807             }
1808             else
1809             {
1810                 // check for space 's' character
1811                 if (gKeyboardMap[keyCode].label3[0] == L's')
1812                     label = L" "; //space
1813                 else
1814                     label = gKeyboardMap[keyCode].label3;
1815             }
1816             break;
1817         case KEYBOARD_KEY_LABEL_4:
1818             if (gKeyboardMap[keyCode].label4[0] == L'n' &&
1819                 gKeyboardMap[keyCode].label4[1] == 0)
1820             {
1821                 label = L"";
1822             }
1823             else
1824             {
1825                 if (gKeyboardMap[keyCode].label4[0] == L's')
1826                     label = L" "; //space
1827                 else
1828                     label = gKeyboardMap[keyCode].label4;
1829             }
1830             break;
1831         default:
1832             break;
1833     }
1834     return label;
1835 */
1836
1837         return String(L"");
1838 }
1839
1840
1841 bool
1842 KeyboardMap::IsKeyAvailable(KeyCode keyCode) const
1843 {
1844 /*
1845     if (gKeyboardMap == null)
1846         return false;
1847     return gKeyboardMap[keyCode].available;
1848 */
1849
1850         return false;
1851 }
1852
1853
1854 String
1855 KeyboardMap::GetKeyboardType(void) const
1856 {
1857 /*
1858     String type(L"");
1859     if (gKeyBoardTypeName == null)
1860         return type;
1861     type = (const wchar_t*) gKeyBoardTypeName;
1862     return type;
1863 */
1864         return String(L"");
1865 }
1866
1867
1868 result
1869 KeyboardMap::LoadKeyboarMapFromFile(void)
1870 {
1871         return E_SUCCESS;
1872 }
1873
1874
1875 KeyboardMapType
1876 GetKeyboardMapType(void)
1877 {
1878 /*
1879     KeyboardMapType type = KEYBOARD_MAP_NONE;
1880
1881     // get keyboard type
1882     String keyboardTypeKey(L"KeyboardType");
1883     String keyboardType;
1884     String country;
1885     String operatorCountryKey(L"OperatorCountry");
1886     int operatorCountry = 0;
1887
1888     result r = _SystemInfoImpl::GetSysInfo(keyboardTypeKey, keyboardType);
1889     if (r != E_SUCCESS)
1890     {
1891         SysLogExceptionxception("[E_SYSTEM] Unable to get keyboard type.");
1892         goto CATCH;
1893     }
1894
1895
1896     if (keyboardType == L"QWERTY")
1897     {
1898         // get operator country
1899         type = KEYBOARD_MAP_GLB;
1900         r =_SystemInfoImpl::GetSysInfo(operatorCountryKey, country);
1901         if (r != E_SUCCESS)
1902         {
1903             SysLogExceptionxception("[E_SYSTEM] Unable to get operator country.");
1904             goto CATCH;
1905         }
1906
1907 #if !defined( _WIN32 )
1908         // search table
1909         for (int i = 0; i < KEYBOARD_MAP_TYPE_MAX; i++)
1910         {
1911             if (country == gKeyboardMapTypes[i].country)
1912             {
1913                 type = gKeyboardMapTypes[i].type;
1914                 break;
1915             }
1916         }
1917 #else
1918         operatorCountry = NvGetInt( NV_SI_OPERATOR_COUNTRY );
1919         switch (operatorCountry)
1920         {
1921             case NV_OPERATOR_COUNTRY_FRANCE:
1922             {
1923                 type = KEYBOARD_MAP_FRA;
1924             }
1925             break;
1926             case NV_OPERATOR_COUNTRY_GERMANY:
1927             {
1928                 type = KEYBOARD_MAP_DEU;
1929             }
1930             break;
1931             case NV_OPERATOR_COUNTRY_SPAIN:
1932             {
1933                 type = KEYBOARD_MAP_ESP;
1934             }
1935             break;
1936             case NV_OPERATOR_COUNTRY_ITALY:
1937             {
1938                 type = KEYBOARD_MAP_ITA;
1939             }
1940             break;
1941             case NV_OPERATOR_COUNTRY_PORTUGAL:
1942             {
1943                 type = KEYBOARD_MAP_PRT;
1944             }
1945             break;
1946             case NV_OPERATOR_COUNTRY_GREECE:
1947             {
1948                  type = KEYBOARD_MAP_GRC;
1949             }
1950             break;
1951             case NV_OPERATOR_COUNTRY_RUSSIA:
1952             {
1953                  type = KEYBOARD_MAP_RUS;
1954             }
1955             break;
1956             case NV_OPERATOR_COUNTRY_FINLAND: // nordic
1957             {
1958                 type = KEYBOARD_MAP_NOR;
1959             }
1960             break;
1961             case NV_OPERATOR_COUNTRY_SINGAPORE:
1962             {
1963                 type = KEYBOARD_MAP_SGP;
1964             }
1965             break;
1966             case NV_OPERATOR_COUNTRY_THAILAND:
1967             {
1968                 type = KEYBOARD_MAP_THA;
1969             }
1970             break;
1971             case NV_OPERATOR_COUNTRY_VIETNAM: // L2 singapore
1972             {
1973                 type = KEYBOARD_MAP_VNM;
1974             }
1975             break;
1976             case NV_OPERATOR_COUNTRY_SOUTHAFRICA:
1977             {
1978                 type = KEYBOARD_MAP_ZAF;
1979             }
1980             break;
1981             case NV_OPERATOR_COUNTRY_PAKISTAN:
1982             {
1983                 type = KEYBOARD_MAP_PAK;
1984             }
1985             break;
1986             case NV_OPERATOR_COUNTRY_IRAN:
1987             {
1988                 type = KEYBOARD_MAP_IRN;
1989             }
1990             break;
1991             case NV_OPERATOR_COUNTRY_ARAB:
1992             {
1993                 type = KEYBOARD_MAP_ARB;
1994             }
1995             break;
1996             case NV_OPERATOR_COUNTRY_CHINA:
1997             {
1998                 type = KEYBOARD_MAP_CHN;
1999             }
2000             break;
2001             default:
2002             {
2003                 type = KEYBOARD_MAP_EUR;
2004             }
2005             break;
2006         }
2007 #endif
2008     }
2009     else
2010     {
2011         // if NOT QWERTY load default keyboardmap
2012         type = KEYBOARD_MAP_NONE;
2013     }
2014     return type;
2015
2016 CATCH:
2017     return KEYBOARD_MAP_NONE;
2018 */
2019         return KEYBOARD_MAP_NONE;
2020 }
2021
2022 result
2023 LoadKeyboardMap(void)
2024 {
2025 /*
2026     KeyboardMapType type = GetKeyboardMapType();
2027     switch (type)
2028     {
2029         case KEYBOARD_MAP_NONE:
2030             {
2031                 gKeyboardMap        = gKeyboardMapNONE;
2032                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_NONE_NAME;
2033             }
2034             break;
2035         case KEYBOARD_MAP_GLB:
2036             {
2037                 gKeyboardMap        = gKeyboardMapGLB;
2038                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_GLB_NAME;
2039
2040             }
2041             break;
2042         case KEYBOARD_MAP_EUR:
2043             {
2044                 gKeyboardMap        = gKeyboardMapEUR;
2045                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_EUR_NAME;
2046             }
2047             break;
2048         case KEYBOARD_MAP_ARB:
2049             {
2050                 gKeyboardMap        = gKeyboardMapARB;
2051                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_ARB_NAME;
2052             }
2053             break;
2054         case KEYBOARD_MAP_CHN:
2055             {
2056                 gKeyboardMap        = gKeyboardMapCHN;
2057                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_CHN_NAME;
2058             }
2059             break;
2060         case KEYBOARD_MAP_ESP:
2061             {
2062                 gKeyboardMap        = gKeyboardMapESP;
2063                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_ESP_NAME;
2064             }
2065             break;
2066         case KEYBOARD_MAP_DEU:
2067             {
2068                 gKeyboardMap        = gKeyboardMapDEU;
2069                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_DEU_NAME;
2070             }
2071             break;
2072         case KEYBOARD_MAP_FRA:
2073             {
2074                 gKeyboardMap        = gKeyboardMapFRA;
2075                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_FRA_NAME;
2076
2077             }
2078             break;
2079         case KEYBOARD_MAP_ZAF:
2080             {
2081                 gKeyboardMap        = gKeyboardMapZAF;
2082                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_FRA_NAME;
2083
2084             }
2085             break;
2086         case KEYBOARD_MAP_GRC:
2087             {
2088                 gKeyboardMap        = gKeyboardMapGRC;
2089                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_GRC_NAME;
2090             }
2091             break;
2092         case KEYBOARD_MAP_IRN:
2093             {
2094                 gKeyboardMap        = gKeyboardMapIRN;
2095                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_IRN_NAME;
2096             }
2097             break;
2098         case KEYBOARD_MAP_ITA:
2099             {
2100                 gKeyboardMap        = gKeyboardMapEUR_2;
2101                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_ITA_NAME;
2102             }
2103             break;
2104         case KEYBOARD_MAP_PRT:
2105             {
2106                 gKeyboardMap        = gKeyboardMapEUR_2;
2107                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_PRT_NAME;
2108             }
2109             break;
2110         case KEYBOARD_MAP_NOR:
2111             {
2112                 gKeyboardMap        = gKeyboardMapNOR;
2113                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_NOR_NAME;
2114             }
2115             break;
2116         case KEYBOARD_MAP_PAK:
2117             {
2118                 gKeyboardMap        = gKeyboardMapPAK;
2119                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_PAK_NAME;
2120             }
2121             break;
2122         case KEYBOARD_MAP_RUS:
2123             {
2124                 gKeyboardMap        = gKeyboardMapRUS;
2125                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_RUS_NAME;
2126             }
2127             break;
2128         case KEYBOARD_MAP_SGP:
2129             {
2130                 gKeyboardMap        = gKeyboardMapGLB;
2131                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_SGP_NAME;
2132             }
2133             break;
2134         case KEYBOARD_MAP_THA:
2135             {
2136                 gKeyboardMap        = gKeyboardMapTHA;
2137                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_THA_NAME;
2138             }
2139             break;
2140         case KEYBOARD_MAP_VNM:
2141             {
2142                 gKeyboardMap        = gKeyboardMapVNM;
2143                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_VNM_NAME;
2144             }
2145             break;
2146         default:
2147             {
2148                 gKeyboardMap        = gKeyboardMapNONE;
2149                 gKeyBoardTypeName   = (wchar_t*) KEYBOARD_MAP_NONE_NAME;
2150             }
2151             break;
2152     }
2153     return (E_SUCCESS);
2154 */
2155         return E_SUCCESS;
2156 }
2157
2158 }} // Tizen::Ui