1 /*
2 * ReactOS Portuguese keyboard layout
3 * Copyright (C) 2006 ReactOS
4 * License: LGPL, see: LGPL.txt
5 * Based on kbdes, skbdda and skbdfr
6 *
7 * Made by Pedro Maia pedrom.maia@gmail.com
8 *
9 *
10 * http://keytouch.sourceforge.net/howto_keyboard/node4.html (Very Good)
11 * http://www.microsoft.com/globaldev/tools/msklc.mspx (Keyboard layout file from MS)
12 *
13 * TODO
14 * Correct DEADKEYS
15 * Correct DIVIDE and PrtScr
16 */
17
18 #define WIN32_NO_STATUS
19 #include <stdarg.h>
20 #include <windef.h>
21 #include <winuser.h>
22 #include <ndk/kbd.h>
23
24 #ifdef _M_IA64
25 #define ROSDATA static __declspec(allocate(".data"))
26 #else
27 #ifdef _MSC_VER
28 #pragma data_seg(".data")
29 #define ROSDATA static
30 #else
31 #define ROSDATA static __attribute__((section(".data")))
32 #endif
33 #endif
34
35 #define VK_EMPTY 0xff /* The non-existent VK */
36
37 #define KNUMS KBDNUMPAD|KBDSPECIAL /* Special + number pad */
38 #define KMEXT KBDEXT|KBDMULTIVK /* Multi + ext */
39
40 ROSDATA USHORT scancode_to_vk[] = {
41 /* 00 */ VK_EMPTY,
42 /* 01 */ VK_ESCAPE,
43 /* 02 */ '1',
44 /* 03 */ '2',
45 /* 04 */ '3',
46 /* 05 */ '4',
47 /* 06 */ '5',
48 /* 07 */ '6',
49 /* 08 */ '7',
50 /* 09 */ '8',
51 /* 0a */ '9',
52 /* 0b */ '0',
53 /* 0c */ VK_OEM_4,
54 /* 0d */ VK_OEM_6,
55 /* 0e */ VK_BACK,
56 /* 0f */ VK_TAB,
57 /* 10 */ 'Q',
58 /* 11 */ 'W',
59 /* 12 */ 'E',
60 /* 13 */ 'R',
61 /* 14 */ 'T',
62 /* 15 */ 'Y',
63 /* 16 */ 'U',
64 /* 17 */ 'I',
65 /* 18 */ 'O',
66 /* 19 */ 'P',
67 /* 1a */ VK_OEM_PLUS,
68 /* 1b */ VK_OEM_1,
69 /* 1c */ VK_RETURN,
70 /* 1d */ VK_LCONTROL,
71 /* 1e */ 'A',
72 /* 1f */ 'S',
73 /* 20 */ 'D',
74 /* 21 */ 'F',
75 /* 22 */ 'G',
76 /* 23 */ 'H',
77 /* 24 */ 'J',
78 /* 25 */ 'K',
79 /* 26 */ 'L',
80 /* 27 */ VK_OEM_3,
81 /* 28 */ VK_OEM_7,
82 /* 29 */ VK_OEM_5,
83 /* 2a */ VK_LSHIFT,
84 /* 2b */ VK_OEM_2,
85 /* 2c */ 'Z',
86 /* 2d */ 'X',
87 /* 2e */ 'C',
88 /* 2f */ 'V',
89 /* 30 */ 'B',
90 /* 31 */ 'N',
91 /* 32 */ 'M',
92 /* 33 */ VK_OEM_COMMA,
93 /* 34 */ VK_OEM_PERIOD,
94 /* 35 */ VK_OEM_MINUS,
95 /* 36 */ VK_RSHIFT,
96 /* 37 */ VK_MULTIPLY,
97 /* 38 */ VK_LMENU,
98 /* 39 */ VK_SPACE,
99 /* 3a */ VK_CAPITAL,
100 /* 3b */ VK_F1,
101 /* 3c */ VK_F2,
102 /* 3d */ VK_F3,
103 /* 3e */ VK_F4,
104 /* 3f */ VK_F5,
105 /* 40 */ VK_F6,
106 /* 41 */ VK_F7,
107 /* 42 */ VK_F8,
108 /* 43 */ VK_F9,
109 /* 44 */ VK_F10,
110 /* 45 */ VK_NUMLOCK | KMEXT,
111 /* 46 */ VK_SCROLL | KBDMULTIVK,
112 /* 47 */ VK_HOME | KNUMS,
113 /* 48 */ VK_UP | KNUMS,
114 /* 49 */ VK_PRIOR | KNUMS,
115 /* 4a */ VK_SUBTRACT,
116 /* 4b */ VK_LEFT | KNUMS,
117 /* 4c */ VK_CLEAR | KNUMS,
118 /* 4d */ VK_RIGHT | KNUMS,
119 /* 4e */ VK_ADD,
120 /* 4f */ VK_END | KNUMS,
121 /* 50 */ VK_DOWN | KNUMS,
122 /* 51 */ VK_NEXT | KNUMS,
123 /* 52 */ VK_INSERT | KNUMS,
124 /* 53 */ VK_DELETE | KNUMS,
125 /* 54 */ VK_SNAPSHOT,
126 /* 55 */ VK_EMPTY,
127 /* 56 */ VK_OEM_102,
128 /* 57 */ VK_F11,
129 /* 58 */ VK_F12,
130 /* 59 */ VK_EMPTY,
131 /* 5a */ VK_CLEAR,
132 /* 5b */ VK_EMPTY,
133 /* 5c */ VK_EMPTY,
134 /* 5d */ VK_EMPTY,
135 /* 5e */ VK_EMPTY, /* EREOF */
136 /* 5f */ VK_EMPTY,
137 /* 60 */ VK_EMPTY,
138 /* 61 */ VK_EMPTY,
139 /* 62 */ VK_EMPTY,
140 /* 63 */ VK_EMPTY, /* ZOOM */
141 /* 64 */ VK_HELP,
142 /* 65 */ VK_F13,
143 /* 66 */ VK_F14,
144 /* 67 */ VK_F15,
145 /* 68 */ VK_F16,
146 /* 69 */ VK_F17,
147 /* 6a */ VK_F18,
148 /* 6b */ VK_F19,
149 /* 6c */ VK_F20,
150 /* 6d */ VK_F21,
151 /* 6e */ VK_F22,
152 /* 6f */ VK_F23,
153 /* 70 */ VK_EMPTY,
154 /* 71 */ VK_EMPTY,
155 /* 72 */ VK_EMPTY,
156 /* 73 */ VK_EMPTY,
157 /* 74 */ VK_EMPTY,
158 /* 75 */ VK_EMPTY,
159 /* 76 */ VK_EMPTY,
160 /* 77 */ VK_F24,
161 /* 78 */ VK_EMPTY,
162 /* 79 */ VK_EMPTY,
163 /* 7a */ VK_EMPTY,
164 /* 7b */ VK_EMPTY,
165 /* 7c */ VK_EMPTY,
166 /* 7d */ VK_EMPTY,
167 /* 7e */ VK_EMPTY,
168 };
169
170 ROSDATA VSC_VK extcode0_to_vk[] = {
171 { 0x10, VK_MEDIA_PREV_TRACK | KBDEXT }, // Pista Anterior
172 { 0x19, VK_MEDIA_NEXT_TRACK | KBDEXT }, // Proxima Pista
173 { 0x1D, VK_RCONTROL | KBDEXT }, // Tecla ctrl
174 { 0x20, VK_VOLUME_MUTE | KBDEXT }, // Mute volume
175 { 0x21, VK_LAUNCH_APP2 | KBDEXT }, // Tecla calculadora
176 { 0x22, VK_MEDIA_PLAY_PAUSE | KBDEXT }, // Play/pause
177 { 0x24, VK_MEDIA_STOP | KBDEXT }, // Stop
178 { 0x2E, VK_VOLUME_DOWN | KBDEXT }, // Baixar volume
179 { 0x30, VK_VOLUME_UP | KBDEXT }, // Subir volume
180 { 0x32, VK_BROWSER_HOME | KBDEXT }, // Pagina predefinida do navegador de internet, ou abri-lo se n�o estiver activo
181 { 0x35, VK_DIVIDE | KBDEXT }, // Tecla /
182 { 0x37, VK_SNAPSHOT | KBDEXT }, // Tecla de Print Screen
183 { 0x38, VK_RMENU | KBDEXT }, // Tecla Alt
184 { 0x47, VK_HOME | KBDEXT }, // Tecla Home
185 { 0x48, VK_UP | KBDEXT }, // Cursor Cima
186 { 0x49, VK_PRIOR | KBDEXT }, // Tecla Re pag
187 { 0x4b, VK_LEFT | KBDEXT }, // Cursor esquerda
188 { 0x4d, VK_RIGHT | KBDEXT }, // Cursor direita
189 { 0x4f, VK_END | KBDEXT }, // Tecla End
190 { 0x50, VK_DOWN | KBDEXT }, // Cursor Down
191 { 0x51, VK_NEXT | KBDEXT }, // Tecla Av pag
192 { 0x52, VK_INSERT | KBDEXT }, // Tecla insert
193 { 0x53, VK_DELETE | KBDEXT }, // Tecla delete
194 { 0x5b, VK_LWIN | KBDEXT }, // Tecla windows esquerda
195 { 0x5c, VK_RWIN | KBDEXT }, // Tecla windows direita
196 { 0x5d, VK_APPS | KBDEXT }, // Tecla menu aplicacao direita*/
197 { 0x5f, VK_SLEEP | KBDEXT }, // Tecla Sleep
198 { 0x65, VK_BROWSER_SEARCH | KBDEXT }, // Pagina de pesquisa do navegador de internet
199 { 0x66, VK_BROWSER_FAVORITES | KBDEXT }, // Favoritos, not yet implemented
200 { 0x67, VK_BROWSER_REFRESH | KBDEXT }, // Actualizar pagina do navegador de internet
201 { 0x68, VK_BROWSER_STOP | KBDEXT }, // Parar navega��o na internet internet
202 { 0x69, VK_BROWSER_FORWARD | KBDEXT }, // Frente no historico de paginas no navegador de internet
203 { 0x6a, VK_BROWSER_BACK | KBDEXT }, // Atras no historico de paginas no navegador de internet (Backspace)
204 { 0x6b, VK_LAUNCH_APP1 | KBDEXT }, // Tecla Meu Computador
205 { 0x6c, VK_LAUNCH_MAIL | KBDEXT }, // Abrir programa de e-mail
206 { 0x6d, VK_LAUNCH_MEDIA_SELECT | KBDEXT }, // Abrir reproductor multimedia
207 { 0x1c, VK_RETURN | KBDEXT }, // Tecla de Enter
208 { 0x46, VK_CANCEL | KBDEXT }, // Tecla Escape
209 { 0, 0 },
210 };
211
212 ROSDATA VSC_VK extcode1_to_vk[] = {
213 { 0, 0 },
214 };
215
216 #define TIDLE_CIRC VK_OEM_2
217 #define ACUTE_GRAVE VK_OEM_1
218 #define ORDERN_SUPERSCRIPT VK_OEM_7
219 #define CCEDIL VK_OEM_3
220 #define QUOTE VK_OEM_4
221 #define BACKSLASH_BAR VK_OEM_5
222 #define CLASSIC_QUOTES VK_OEM_6
223 #define MATH_RELATE VK_OEM_102
224
225 #define ACUTE_CHAR 0xB4
226 #define GRAVE_CHAR 0x60
227 #define CIRC_CHAR 0x5E
228 #define TIDLE_CHAR 0x7E
229 #define TREMA_CHAR 0xA8
230
231 /* Modifiers */
232
233 ROSDATA VK_TO_BIT modifier_keys[] = {
234 { VK_SHIFT, KBDSHIFT },
235 { VK_CONTROL, KBDCTRL },
236 { VK_MENU, KBDALT },
237 { 0, 0 }
238 };
239
240 ROSDATA MODIFIERS modifier_bits = {
241 modifier_keys,
242 6,
243 { 0, 1<<0, 1<<1, 1<<2, SHFT_INVALID, SHFT_INVALID, 3 }
244 /* NONE, SHIFT, CTRL, ALT, MENU, SHIFT + MENU, SHIFT+CONTROL */
245 };
246
247 ROSDATA VK_TO_WCHARS1 keypad_numbers[] = {
248 { VK_NUMPAD0, 0, {'0'} },
249 { VK_NUMPAD1, 0, {'1'} },
250 { VK_NUMPAD2, 0, {'2'} },
251 { VK_NUMPAD3, 0, {'3'} },
252 { VK_NUMPAD4, 0, {'4'} },
253 { VK_NUMPAD5, 0, {'5'} },
254 { VK_NUMPAD6, 0, {'6'} },
255 { VK_NUMPAD7, 0, {'7'} },
256 { VK_NUMPAD8, 0, {'8'} },
257 { VK_NUMPAD9, 0, {'9'} },
258 { VK_DECIMAL, 0, {'.'} },
259 { 0,0 }
260 };
261
262 ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = {
263 /* Normal vs Shifted */
264
265 /* The alphabet */
266 { 'A', CAPLOK, {'a', 'A'} },
267 { 'B', CAPLOK, {'b', 'B'} },
268 { 'C', CAPLOK, {'c', 'C'} },
269 { 'D', CAPLOK, {'d', 'D'} },
270 { 'F', CAPLOK, {'f', 'F'} },
271 { 'G', CAPLOK, {'g', 'G'} },
272 { 'H', CAPLOK, {'h', 'H'} },
273 { 'I', CAPLOK, {'i', 'I'} },
274 { 'J', CAPLOK, {'j', 'J'} },
275 { 'K', CAPLOK, {'k', 'K'} },
276 { 'L', CAPLOK, {'l', 'L'} },
277 { 'M', CAPLOK, {'m', 'M'} },
278 { 'N', CAPLOK, {'n', 'N'} },
279 { 'O', CAPLOK, {'o', 'O'} },
280 { 'P', CAPLOK, {'p', 'P'} },
281 { 'Q', CAPLOK, {'q', 'Q'} },
282 { 'R', CAPLOK, {'r', 'R'} },
283 { 'S', CAPLOK, {'s', 'S'} },
284 { 'T', CAPLOK, {'t', 'T'} },
285 { 'U', CAPLOK, {'u', 'U'} },
286 { 'V', CAPLOK, {'v', 'V'} },
287 { 'W', CAPLOK, {'w', 'W'} },
288 { 'X', CAPLOK, {'x', 'X'} },
289 { 'Y', CAPLOK, {'y', 'Y'} },
290 { 'Z', CAPLOK, {'z', 'Z'} },
291
292 /* The numbers */
293 //De 2 ate 4 tem tres estados
294 { '1', 0, {'1', '!'} },
295 { '5', 0, {'5', '%'} },
296 { '6', 0, {'6', '&'} },
297 //De 7 ate 0 tem tres estados
298
299 /* Specials */
300 /* Shift-_ generates PT */
301 { TIDLE_CIRC, 0, { WCH_DEAD, WCH_DEAD} },
302 { VK_EMPTY, 0, { TIDLE_CHAR, CIRC_CHAR} },
303
304 { CCEDIL, CAPLOK, { 0xe7, 0xc7} }, // �
305 { QUOTE, 0, { 0xb4, '?'} }, // ' ?
306 { BACKSLASH_BAR, 0, { 0x5c, 0x7c} }, // \ |
307 { CLASSIC_QUOTES, 0, { 0xab, 0xbb} }, // � �
308
309 { ACUTE_GRAVE, 0, { WCH_DEAD, WCH_DEAD} }, // ` '
310 { VK_EMPTY, 0, { ACUTE_CHAR, GRAVE_CHAR} },
311
312 { ORDERN_SUPERSCRIPT, 0, { 0xBA, 0xAA} }, // � �
313 { MATH_RELATE, 0, { '<', '>'} },
314 { VK_OEM_COMMA, 0, { ',', ';'} },
315 { VK_OEM_PERIOD, 0, { '.', ':'} },
316 { VK_OEM_MINUS, 0, { '-', '_'} },
317
318 /* Keys that do not have shift states */
319 { VK_TAB, 0, { '\t', '\t'} },
320 { VK_ADD, 0, { '+', '+'} },
321 { VK_SUBTRACT, 0, { '-', '-'} },
322 { VK_MULTIPLY, 0, { '*', '*'} },
323 { VK_DIVIDE, 0, { '/', '/'} },
324 { VK_ESCAPE, 0, { 0x1b, 0x1b} },
325 { VK_SPACE, 0, { ' ', ' '} },
326
327 { 0, 0 }
328 };
329
330 ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = {
331 /* Normal, Shifted, Ctrl */
332
333 /* Legacy (telnet-style) ascii escapes */
334 { VK_RETURN, 0, {'\r', '\r', '\n'} },
335 { VK_BACK, 0, {'\b', '\b', 0x7f} },
336 { 0,0 }
337 };
338
339 ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = {
340 /* Normal, Shift, Control, Alt+Gr */
341
342 { '2', 0, { '2', '"', WCH_NONE, '@' } }, // 2 " @
343 { '3', 0, { '3', '#', WCH_NONE, 0xa3 } }, // 3 #
344 { '4', 0, { '4', '$', WCH_NONE, 0xa7 } }, // 4 $
345 { '7', 0, { '7', '/', WCH_NONE, 0x7b } }, // 7 &
346 { '8', 0, { '8', '(', WCH_NONE, 0x5b } }, // 8 (
347 { '9', 0, { '9', ')', WCH_NONE, 0x5d } }, // 9 )
348 { '0', 0, { '0', '=', WCH_NONE, 0x7d } }, // 0 =
349 { 'E', CAPLOK, { 'e', 'E', WCH_NONE, 0x20ac } }, // e E
350
351 { VK_OEM_PLUS, 0, { '+', '*', WCH_NONE, WCH_DEAD } }, // + * "
352 { VK_EMPTY, 0, { '+', '*', WCH_NONE, TREMA_CHAR } },
353 { 0, 0 }
354 };
355
356 #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
357
358 ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = {
359 vk_master(1,keypad_numbers),
360 vk_master(2,key_to_chars_2mod),
361 vk_master(3,key_to_chars_3mod),
362 vk_master(4,key_to_chars_4mod),
363 { 0,0,0 }
364 };
365
366 #define DEADTRANS(ch, accent, comp, flags) MAKELONG(ch, accent), comp, flags
367
368 ROSDATA DEADKEY deadkey[] =
369 {
370 //*�* DEADKEY 00B4
371 { DEADTRANS(L'a', 0xb4, 0xe1, 0x00) }, // letra a com �
372 { DEADTRANS(L'A', 0xb4, 0xc1, 0x00) }, // letra A com �
373 { DEADTRANS(L'e', 0xb4, 0xe9, 0x00) }, // letra e com �
374 { DEADTRANS(L'E', 0xb4, 0xc9, 0x00) }, // letra E com �
375 { DEADTRANS(L'i', 0xb4, 0xed, 0x00) }, // letra i com �
376 { DEADTRANS(L'I', 0xb4, 0xcd, 0x00) }, // letra I com �
377 { DEADTRANS(L'o', 0xb4, 0xf3, 0x00) }, // letra o com �
378 { DEADTRANS(L'O', 0xb4, 0xd3, 0x00) }, // letra O com �
379 { DEADTRANS(L'u', 0xb4, 0xfa, 0x00) }, // letra u com �
380 { DEADTRANS(L'U', 0xb4, 0xda, 0x00) }, // letra U com �
381 { DEADTRANS(L'y', 0xb4, 0xfd, 0x00) }, // letra y com �
382 { DEADTRANS(0x20, 0xb4, 0xb4, 0x00) }, // letra 'space' (0x0020) com �
383
384 //*`* DEADKEY 0060
385 { DEADTRANS(L'a', 0x60, 0xe0, 0x00) }, // letra a com `
386 { DEADTRANS(L'A', 0x60, 0xc0, 0x00) }, // letra A com `
387 { DEADTRANS(L'e', 0x60, 0xe8, 0x00) }, // letra e com `
388 { DEADTRANS(L'E', 0x60, 0xc8, 0x00) }, // letra E com `
389 { DEADTRANS(L'i', 0x60, 0xec, 0x00) }, // letra i com `
390 { DEADTRANS(L'I', 0x60, 0xcc, 0x00) }, // letra I com `
391 { DEADTRANS(L'o', 0x60, 0xf2, 0x00) }, // letra o com `
392 { DEADTRANS(L'O', 0x60, 0xd2, 0x00) }, // letra O com `
393 { DEADTRANS(L'u', 0x60, 0xf9, 0x00) }, // letra u com `
394 { DEADTRANS(L'U', 0x60, 0xd9, 0x00) }, // letra U com `
395 { DEADTRANS(0x20, 0x60, 0x60, 0x00) }, // letra 'space' (0x0020) com `
396
397 //*^* DEADKEY 005E
398 { DEADTRANS(L'a', 0x5e, 0xe2, 0x00) }, // letra a com ^
399 { DEADTRANS(L'A', 0x5e, 0xc2, 0x00) }, // letra A com ^
400 { DEADTRANS(L'e', 0x5e, 0xea, 0x00) }, // letra e com ^
401 { DEADTRANS(L'E', 0x5e, 0xca, 0x00) }, // letra E com ^
402 { DEADTRANS(L'i', 0x5e, 0xee, 0x00) }, // letra i com ^
403 { DEADTRANS(L'I', 0x5e, 0xce, 0x00) }, // letra I com ^
404 { DEADTRANS(L'o', 0x5e, 0xf4, 0x00) }, // letra o com ^
405 { DEADTRANS(L'O', 0x5e, 0xd4, 0x00) }, // letra O com ^
406 { DEADTRANS(L'u', 0x5e, 0xfb, 0x00) }, // letra u com ^
407 { DEADTRANS(L'U', 0x5e, 0xdb, 0x00) }, // letra U com ^
408 { DEADTRANS(0x20, 0x5e, 0x5e, 0x00) }, // letra 'space' (0x0020) com ^
409
410 //*~* DEADKEY 007E
411 { DEADTRANS(L'a', 0x7e, 0xe3, 0x00) }, // letra a com ~
412 { DEADTRANS(L'A', 0x7e, 0xc3, 0x00) }, // letra A com ~
413 { DEADTRANS(L'n', 0x7e, 0xf1, 0x00) }, // letra e com ~
414 { DEADTRANS(L'N', 0x7e, 0xd1, 0x00) }, // letra E com ~
415 { DEADTRANS(L'o', 0x7e, 0xf5, 0x00) }, // letra i com ~
416 { DEADTRANS(L'O', 0x7e, 0xd5, 0x00) }, // letra I com ~
417 { DEADTRANS(0x20, 0x7e, 0x7e, 0x00) }, // letra 'space' (0x0020) com ~
418
419 //*"* DEADKEY 00A8
420 { DEADTRANS(L'a', 0xa8, 0xe4, 0x00) }, // letra a com "
421 { DEADTRANS(L'A', 0xa8, 0xc4, 0x00) }, // letra A com "
422 { DEADTRANS(L'e', 0xa8, 0xeb, 0x00) }, // letra e com "
423 { DEADTRANS(L'E', 0xa8, 0xcb, 0x00) }, // letra E com "
424 { DEADTRANS(L'i', 0xa8, 0xef, 0x00) }, // letra i com "
425 { DEADTRANS(L'I', 0xa8, 0xcf, 0x00) }, // letra I com "
426 { DEADTRANS(L'o', 0xa8, 0xf6, 0x00) }, // letra o com "
427 { DEADTRANS(L'O', 0xa8, 0xd6, 0x00) }, // letra O com "
428 { DEADTRANS(L'u', 0xa8, 0xfc, 0x00) }, // letra u com "
429 { DEADTRANS(L'U', 0xa8, 0xdc, 0x00) }, // letra U com "
430 { DEADTRANS(L'y', 0xa8, 0xff, 0x00) }, // letra y com "
431 { DEADTRANS(0x20, 0xa8, 0xa8, 0x00) }, // letra 'space' (0x0020) com "
432
433 { 0, 0, 0}
434 };
435
436 ROSDATA VSC_LPWSTR key_names[] = {
437 { 0x01, L"Escape" },
438 { 0x0e, L"BackSpace" },
439 { 0x0f, L"Tab" },
440 { 0x1c, L"Enter" },
441 { 0x1d, L"Ctrl" },
442 { 0x2a, L"Shift" },
443 { 0x36, L"Shift Direito" },
444 { 0x37, L"* Num" },
445 { 0x38, L"Alt" },
446 { 0x39, L"Espaco" },
447 { 0x3a, L"CAPLOK Lock" },
448 { 0x3b, L"F1" },
449 { 0x3c, L"F2" },
450 { 0x3d, L"F3" },
451 { 0x3e, L"F4" },
452 { 0x3f, L"F5" },
453 { 0x40, L"F6" },
454 { 0x41, L"F7" },
455 { 0x42, L"F8" },
456 { 0x43, L"F9" },
457 { 0x44, L"F10" },
458 { 0x45, L"Pausa" },
459 { 0x46, L"Scroll Lock" },
460 { 0x47, L"Num 7" },
461 { 0x48, L"Num 8" },
462 { 0x49, L"Num 9" },
463 { 0x4a, L"Num -" },
464 { 0x4b, L"Num 4" },
465 { 0x4c, L"Num 5" },
466 { 0x4d, L"Num 6" },
467 { 0x4e, L"Num +" },
468 { 0x4f, L"Num 1" },
469 { 0x50, L"Num 2" },
470 { 0x51, L"Num 3" },
471 { 0x52, L"Num 0" },
472 { 0x53, L"Del Num" },
473 { 0x54, L"System Request" },
474 { 0x57, L"F11" },
475 { 0x58, L"F12" },
476 { 0x7c, L"F13" },
477 { 0x7d, L"F14" },
478 { 0x7e, L"F15" },
479 { 0x7f, L"F16" },
480 { 0x80, L"F17" },
481 { 0x81, L"F18" },
482 { 0x82, L"F19" },
483 { 0x83, L"F20" },
484 { 0x84, L"F21" },
485 { 0x85, L"F22" },
486 { 0x86, L"F23" },
487 { 0x87, L"F24" },
488 { 0, NULL },
489 };
490
491 ROSDATA VSC_LPWSTR extended_key_names[] = {
492 { 0x1c, L"Enter Num" },
493 { 0x1d, L"Ctrl direito" },
494 { 0x35, L"/ Num" },
495 { 0x37, L"Print Screen" },
496 { 0x38, L"Alt Direito" },
497 { 0x45, L"Num Lock" },
498 { 0x46, L"Pausa" },
499
500 { 0x47, L"Home" },
501 { 0x4f, L"End" },
502
503 { 0x52, L"Insert" },
504 { 0x53, L"Delete" },
505
506 { 0x49, L"Page Up" },
507 { 0x51, L"Page Down" },
508
509 { 0x48, L"Cima" },
510 { 0x50, L"Baixo" },
511 { 0x4b, L"Esquerda" },
512 { 0x4d, L"Direita" },
513
514 { 0x54, L"<ReactOS>" },
515 { 0x56, L"Ajuda" },
516 { 0x5b, L"Windows Esquerda" },
517 { 0x5c, L"Windows Direita" },
518 { 0x5d, L"Aplicacao" },
519
520 { 0, NULL },
521 };
522
523 ROSDATA DEADKEY_LPWSTR dead_key_names[] = {
524 L"\x00b4" L"Agudo",
525 L"\x0060" L"Grave",
526 L"\x005e" L"Circunflexo",
527 L"\x007e" L"Til",
528 L"\x00a8" L"Trema",
529 NULL
530 };
531
532 /* Finally, the master table */
533 ROSDATA KBDTABLES keyboard_layout_table = {
534
535 /* modifier assignments */
536 &modifier_bits,
537
538 /* character from vk tables */
539 vk_to_wchar_master_table,
540
541 /* diacritical marks -- currently implemented by wine code */
542 /* Portuguese have severals */
543 deadkey,
544
545 /* Key names */
546 (VSC_LPWSTR *)key_names,
547 (VSC_LPWSTR *)extended_key_names,
548 dead_key_names,
549 /* Dead key names */
550
551 /* scan code to virtual key maps */
552 scancode_to_vk,
553 RTL_NUMBER_OF(scancode_to_vk),
554 extcode0_to_vk,
555 extcode1_to_vk,
556
557 MAKELONG(KLLF_ALTGR, 1), /* Version 1.0 */
558
559 /* Ligatures -- Portuguese doesn't have any, that i'm aware */
560 0,
561 0,
562
563 NULL
564 };
565
KbdLayerDescriptor(VOID)566 PKBDTABLES WINAPI KbdLayerDescriptor(VOID) {
567 return &keyboard_layout_table;
568 }
569