xref: /reactos/dll/keyboard/kbdsw/kbdsw.c (revision 29fa274d)
1 /*
2  * ReactOS Swedish ASCII Keyboard layout
3  * Copyright (C) 2004 ReactOS
4  * License: LGPL, see: LGPL.txt
5  *
6  * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php
7  * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
8  */
9 
10 #include <windows.h>
11 #include <internal/kbd.h>
12 
13 #ifdef _M_IA64
14 #define ROSDATA static __declspec(allocate(".data"))
15 #else
16 #ifdef _MSC_VER
17 #pragma data_seg(".data")
18 #define ROSDATA static
19 #else
20 #define ROSDATA static __attribute__((section(".data")))
21 #endif
22 #endif
23 
24 #define VK_EMPTY 0xff   /* The non-existent VK */
25 #define KSHIFT   0x001  /* Shift modifier */
26 #define KCTRL    0x002  /* Ctrl modifier */
27 #define KALT     0x004  /* Alt modifier */
28 #define KEXT     0x100  /* Extended key code */
29 #define KMULTI   0x200  /* Multi-key */
30 #define KSPEC    0x400  /* Special key */
31 #define KNUMP    0x800  /* Number-pad */
32 #define KNUMS    0xc00  /* Special + number pad */
33 #define KMEXT    0x300  /* Multi + ext */
34 
35 #define SHFT_INVALID 0x0F
36 
37 ROSDATA USHORT scancode_to_vk[] = {
38   /* Numbers Row */
39   /* - 00 - */
40   /* 1 ...         2 ...         3 ...         4 ... */
41   VK_EMPTY,     VK_ESCAPE,    '1',          '2',
42   '3',          '4',          '5',          '6',
43   '7',          '8',          '9',          '0',
44   VK_OEM_PLUS, VK_OEM_4,  VK_BACK,
45   /* - 0f - */
46   /* First Letters Row */
47   VK_TAB,       'Q',          'W',          'E',
48   'R',          'T',          'Y',          'U',
49   'I',          'O',          'P',
50   VK_OEM_6,     VK_OEM_1,     VK_RETURN,
51   /* - 1d - */
52   /* Second Letters Row */
53   VK_LCONTROL,
54   'A',          'S',          'D',          'F',
55   'G',          'H',          'J',          'K',
56   'L',          VK_OEM_3,     VK_OEM_7,     VK_OEM_5,
57   VK_LSHIFT,    VK_OEM_2,
58   /* - 2c - */
59   /* Third letters row */
60   'Z',          'X',          'C',          'V',
61   'B',          'N',          'M',          VK_OEM_COMMA,
62   VK_OEM_PERIOD,VK_OEM_MINUS,     VK_RSHIFT,
63   /* - 37 - */
64   /* Bottom Row */
65   VK_MULTIPLY,  VK_LMENU,     VK_SPACE,     VK_CAPITAL,
66 
67   /* - 3b - */
68   /* F-Keys */
69   VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6,
70   VK_F7, VK_F8, VK_F9, VK_F10,
71   /* - 45 - */
72   /* Locks */
73   VK_NUMLOCK | KMEXT,
74   VK_SCROLL | KMULTI,
75   /* - 47 - */
76   /* Number-Pad */
77   VK_HOME | KNUMS,      VK_UP | KNUMS,         VK_PRIOR | KNUMS, VK_SUBTRACT,
78   VK_LEFT | KNUMS,      VK_CLEAR | KNUMS,      VK_RIGHT | KNUMS, VK_ADD,
79   VK_END | KNUMS,       VK_DOWN | KNUMS,       VK_NEXT | KNUMS,
80   VK_INSERT | KNUMS,    VK_DELETE | KNUMS,
81   /* - 54 - */
82   /* Presumably PrtSc */
83   VK_SNAPSHOT,
84   /* - 55 - */
85   /* Oddities, and the remaining standard F-Keys */
86   VK_EMPTY,     VK_OEM_102,     VK_F11,       VK_F12,
87   /* - 59 - */
88   VK_CLEAR,     VK_EMPTY,     VK_EMPTY,     VK_EMPTY,     VK_EMPTY, /* EREOF */
89   VK_EMPTY,     VK_EMPTY,     VK_EMPTY,     VK_EMPTY,     VK_EMPTY, /* ZOOM */
90   VK_HELP,
91   /* - 64 - */
92   /* Even more F-Keys (for example, NCR keyboards from the early 90's) */
93   VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20,
94   VK_F21, VK_F22, VK_F23,
95   /* - 6f - */
96   /* Not sure who uses these codes */
97   VK_EMPTY, VK_EMPTY, VK_EMPTY,
98   /* - 72 - */
99   VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY,
100   /* - 76 - */
101   /* One more f-key */
102   VK_F24,
103   /* - 77 - */
104   VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY,
105   VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* PA1 */
106   VK_EMPTY,
107   /* - 80 - */
108   0
109 };
110 
111 ROSDATA VSC_VK extcode0_to_vk[] = {
112   { 0x10, VK_MEDIA_PREV_TRACK | KEXT },
113   { 0x19, VK_MEDIA_NEXT_TRACK | KEXT },
114   { 0x1D, VK_RCONTROL | KEXT },
115   { 0x20, VK_VOLUME_MUTE | KEXT },
116   { 0x21, VK_LAUNCH_APP2 | KEXT },
117   { 0x22, VK_MEDIA_PLAY_PAUSE | KEXT },
118   { 0x24, VK_MEDIA_STOP | KEXT },
119   { 0x2E, VK_VOLUME_DOWN | KEXT },
120   { 0x30, VK_VOLUME_UP | KEXT },
121   { 0x32, VK_BROWSER_HOME | KEXT },
122   { 0x35, VK_DIVIDE | KEXT },
123   { 0x37, VK_SNAPSHOT | KEXT },
124   { 0x38, VK_RMENU | KEXT },
125   { 0x47, VK_HOME | KEXT },
126   { 0x48, VK_UP | KEXT },
127   { 0x49, VK_PRIOR | KEXT },
128   { 0x4B, VK_LEFT | KEXT },
129   { 0x4D, VK_RIGHT | KEXT },
130   { 0x4F, VK_END | KEXT },
131   { 0x50, VK_DOWN | KEXT },
132   { 0x51, VK_NEXT | KEXT },
133   { 0x52, VK_INSERT | KEXT },
134   { 0x53, VK_DELETE | KEXT },
135   { 0x5B, VK_LWIN | KEXT },
136   { 0x5C, VK_RWIN | KEXT },
137   { 0x5D, VK_APPS | KEXT },
138   { 0x5F, VK_SLEEP | KEXT },
139   { 0x65, VK_BROWSER_SEARCH | KEXT },
140   { 0x66, VK_BROWSER_FAVORITES | KEXT },
141   { 0x67, VK_BROWSER_REFRESH | KEXT },
142   { 0x68, VK_BROWSER_STOP | KEXT },
143   { 0x69, VK_BROWSER_FORWARD | KEXT },
144   { 0x6A, VK_BROWSER_BACK | KEXT },
145   { 0x6B, VK_LAUNCH_APP1 | KEXT },
146   { 0x6C, VK_LAUNCH_MAIL | KEXT },
147   { 0x6D, VK_LAUNCH_MEDIA_SELECT | KEXT },
148   { 0x1C, VK_RETURN | KEXT },
149   { 0x46, VK_CANCEL | KEXT },
150   { 0, 0 },
151 };
152 
153 ROSDATA VSC_VK extcode1_to_vk[] = {
154   { 0x1d, VK_PAUSE},
155   { 0, 0 },
156 };
157 
158 ROSDATA VK_TO_BIT modifier_keys[] = {
159   { VK_SHIFT,   KSHIFT },
160   { VK_CONTROL, KCTRL },
161   { VK_MENU,    KALT },
162   { 0,          0 }
163 };
164 
165 ROSDATA MODIFIERS modifier_bits = {
166   modifier_keys,
167   6,
168   { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT, MENU, SHIFT + MENU, CTRL + MENU */
169 };
170 
171 #define NOCAPS 0
172 #define CAPS   KSHIFT /* Caps -> shift */
173 
174 ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = {
175 
176   /* The numbers */
177   { '1',         NOCAPS, {'1', '!'} },
178   /* Ctrl-2 generates NUL */
179 
180   /* Specials */
181   { VK_OEM_4, 	NOCAPS, {WCH_DEAD, WCH_DEAD} },
182   { VK_OEM_7,	CAPS, {0xe4,0xc4} },
183   { VK_OEM_3,	CAPS, {0xf6, 0xd6} },
184 
185   { VK_OEM_COMMA,  CAPS, {',', ';'} },
186   { VK_OEM_PERIOD, CAPS, {'.', ':'} },
187   { VK_OEM_2,    NOCAPS, {'\'', '*'} },
188 
189   { VK_DECIMAL,    NOCAPS, {',',','} },
190   { VK_TAB,        NOCAPS, {'\t', '\t'} },
191   { VK_ADD,        NOCAPS, {'+', '+'} },
192   { VK_DIVIDE,     NOCAPS, {'/', '/'} },
193   { VK_MULTIPLY,   NOCAPS, {'*', '*'} },
194   { VK_SUBTRACT,   NOCAPS, {'-', '-'} },
195   { 0, 0 }
196 };
197 
198 ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = {
199   /* Normal, Shifted, Ctrl */
200 
201   /* The alphabet */
202   { 'A',         CAPS,   {'a', 'A', 0x01} },
203   { 'B',         CAPS,   {'b', 'B', 0x02} },
204   { 'C',         CAPS,   {'c', 'C', 0x03} },
205   { 'D',         CAPS,   {'d', 'D', 0x04} },
206   { 'F',         CAPS,   {'f', 'F', 0x06} },
207   { 'G',         CAPS,   {'g', 'G', 0x07} },
208   { 'H',         CAPS,   {'h', 'H', 0x08} },
209   { 'I',         CAPS,   {'i', 'I', 0x09} },
210   { 'J',         CAPS,   {'j', 'J', 0x0a} },
211   { 'K',         CAPS,   {'k', 'K', 0x0b} },
212   { 'L',         CAPS,   {'l', 'L', 0x0c} },
213   { 'N',         CAPS,   {'n', 'N', 0x0e} },
214   { 'O',         CAPS,   {'o', 'O', 0x0f} },
215   { 'P',         CAPS,   {'p', 'P', 0x10} },
216   { 'Q',         CAPS,   {'q', 'Q', 0x11} },
217   { 'R',         CAPS,   {'r', 'R', 0x12} },
218   { 'S',         CAPS,   {'s', 'S', 0x13} },
219   { 'T',         CAPS,   {'t', 'T', 0x14} },
220   { 'U',         CAPS,   {'u', 'U', 0x15} },
221   { 'V',         CAPS,   {'v', 'V', 0x16} },
222   { 'W',         CAPS,   {'w', 'W', 0x17} },
223   { 'X',         CAPS,   {'x', 'X', 0x18} },
224   { 'Y',         CAPS,   {'y', 'Y', 0x19} },
225   { 'Z',         CAPS,   {'z', 'Z', 0x1a} },
226 
227   /* Legacy (telnet-style) ascii escapes */
228   {VK_OEM_6, CAPS, {0xe5,0xc5, 0x1d /* GS */} },
229   { VK_OEM_5, NOCAPS, {0xa7,0xbd, 0x1c /* FS */} },
230   { VK_OEM_MINUS, NOCAPS, {'-', '_', 0x1f /* US */} },
231   { VK_RETURN,NOCAPS, {'\r', '\r', '\n'} },
232 
233   { VK_BACK, NOCAPS, {'\b', '\b', 0x7f} },
234   { VK_ESCAPE, NOCAPS, {0x1b, 0x1b, 0x1b} },
235   { VK_SPACE, NOCAPS, {' ', ' ', ' '} },
236   { VK_CANCEL, NOCAPS, {0x03, 0x03, 0x03} },
237 
238   { 0,0 }
239 };
240 
241 ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = {
242   /* Normal, Shifted, Ctrl, Ctrl-Alt */
243   /* Legacy Ascii generators */
244 
245   { '2', NOCAPS, {'2', '\"', WCH_NONE,'@'} },
246   { '3', NOCAPS, {'3', '#', WCH_NONE, 0x00a3} },
247   { '4', NOCAPS, {'4', 0xa4, WCH_NONE, '$'} },
248   { '5', NOCAPS, {'5', '%',  WCH_NONE, 0x00ac} },
249   { '7', NOCAPS, {'7', '/', WCH_NONE, '{'} },
250   { '8', NOCAPS, {'8', '(', WCH_NONE, '['} },
251   { '9', NOCAPS, {'9', ')', WCH_NONE, ']'} },
252   { '0', NOCAPS, {'0', '=', WCH_NONE, '}'} },
253   { VK_OEM_PLUS ,NOCAPS, {'+', '?', WCH_NONE, '\\'} },
254   { 'E', CAPS,   {'e', 'E' , 0x05, 0x00ac} },
255   { VK_OEM_1 ,NOCAPS, {0xa8, '^', 0x001d, '~'} },
256   { 'M', CAPS,   {'m', 'M', 0x0d, 0x00b5} },
257   {VK_OEM_102, NOCAPS, {'<', '>' ,0x001c,'|'} },
258   { 0, 0 }
259 };
260 
261 ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[] = {
262   /* Normal, Shifted, Ctrl, Ctrl-Alt, C-S-x */
263   { '6', NOCAPS, {'6', '&', WCH_NONE, WCH_NONE, 0x1e /* RS */} },
264   { 0, 0 }
265 };
266 
267 ROSDATA VK_TO_WCHARS1 keypad_numbers[] = {
268   { VK_DECIMAL, 0, {'.'} },
269   { VK_NUMPAD0, 0, {'0'} },
270   { VK_NUMPAD1, 0, {'1'} },
271   { VK_NUMPAD2, 0, {'2'} },
272   { VK_NUMPAD3, 0, {'3'} },
273   { VK_NUMPAD4, 0, {'4'} },
274   { VK_NUMPAD5, 0, {'5'} },
275   { VK_NUMPAD6, 0, {'6'} },
276   { VK_NUMPAD7, 0, {'7'} },
277   { VK_NUMPAD8, 0, {'8'} },
278   { VK_NUMPAD9, 0, {'9'} },
279   { 0,0 }
280 };
281 
282 #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
283 
284 ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = {
285   vk_master(3,key_to_chars_3mod),
286   vk_master(4,key_to_chars_4mod),
287   vk_master(5,key_to_chars_5mod),
288   vk_master(2,key_to_chars_2mod),
289   vk_master(1,keypad_numbers),
290   { 0,0,0 }
291 };
292 
293 ROSDATA VSC_LPWSTR key_names[] = {
294   { 0x00, L"" },
295   { 0x01, L"ESC" },
296   { 0x0e, L"BACKSTEG" },
297   { 0x0f, L"TAB" },
298   { 0x1c, L"RETUR" },
299   { 0x1d, L"CTRL" },
300   { 0x2a, L"SKIFT" },
301   { 0x36, L"H\x00D6GER SKIFT" },
302   { 0x37, L"NUM * (Numerisk tangent)" },
303   { 0x38, L"ALT" },
304   { 0x39, L"BLANKSTEG" },
305   { 0x3a, L"CAPS LOCK" },
306   { 0x3b, L"F1" },
307   { 0x3c, L"F2" },
308   { 0x3d, L"F3" },
309   { 0x3e, L"F4" },
310   { 0x3f, L"F5" },
311   { 0x40, L"F6" },
312   { 0x41, L"F7" },
313   { 0x42, L"F8" },
314   { 0x43, L"F9" },
315   { 0x44, L"F10" },
316   { 0x45, L"PAUSE" },
317   { 0x46, L"SCROLL LOCK" },
318   { 0x47, L"7 (Numerisk tangent)" },
319   { 0x48, L"8 (Numerisk tangent)" },
320   { 0x49, L"9 (Numerisk tangent)" },
321   { 0x4a, L"- (Numerisk tangent)" },
322   { 0x4b, L"4 (Numerisk tangent)" },
323   { 0x4c, L"5 (Numerisk tangent)" },
324   { 0x4d, L"6 (Numerisk tangent)" },
325   { 0x4e, L"+ (Numerisk tangent)" },
326   { 0x4f, L"1 (Numerisk tangent)" },
327   { 0x50, L"2 (Numerisk tangent)" },
328   { 0x51, L"3 (Numerisk tangent)" },
329   { 0x52, L"0 (Numerisk tangent)" },
330   { 0x53, L"DECIMAL (Numerisk tangent)" },
331   { 0x54, L"Sys Req" },
332   { 0x57, L"F11" },
333   { 0x58, L"F12" },
334   { 0x7c, L"F13" },
335   { 0x7d, L"F14" },
336   { 0x7e, L"F15" },
337   { 0x7f, L"F16" },
338   { 0x80, L"F17" },
339   { 0x81, L"F18" },
340   { 0x82, L"F19" },
341   { 0x83, L"F20" },
342   { 0x84, L"F21" },
343   { 0x85, L"F22" },
344   { 0x86, L"F23" },
345   { 0x87, L"F24" },
346   { 0, NULL }
347 };
348 
349 ROSDATA VSC_LPWSTR extended_key_names[] = {
350   { 0x1c, L"RETUR (Numerisk tangent)" },
351   { 0x1d, L"H\x00D6GER CTRL" },
352   { 0x35, L"DIVISION (Numerisk tangent)" },
353   { 0x37, L"PRINT SCREEN" },
354   { 0x38, L"H\x00D6GER ALT" },
355   { 0x45, L"NUM LOCK" },
356   { 0x46, L"BREAK" },
357   { 0x47, L"HOME" },
358   { 0x48, L"UPPIL" },
359   { 0x49, L"PAGE UP" },
360   { 0x4b, L"V\x00C4NSTER PIL" },
361 //{ 0x4c, L"Center" },
362   { 0x4d, L"H\x00D6GER PIL" },
363   { 0x4f, L"END" },
364   { 0x50, L"NEDPIL" },
365   { 0x51, L"PAGE DOWN" },
366   { 0x52, L"INS" },
367   { 0x53, L"DEL" },
368   { 0x54, L"<ReactOS>" },
369   { 0x56, L"HELP" },
370   { 0x5b, L"V\x00C4NSTER <ReactOS>" },
371   { 0x5c, L"H\x00D6GER <ReactOS>" },
372   { 0x5d, L"Program" },
373   { 0, NULL }
374 };
375 
376 ROSDATA DEADKEY_LPWSTR dead_key_names[] = {
377     L"\x00a8"	L"Omljud",
378     L"\x005e"	L"Cirkumflex",
379     L"\x007e"	L"Tilde",
380     L"\x00b4"	L"Akut",
381     L"\x0060"	L"Grav",
382     NULL
383 };
384 
385 #define DEADTRANS(ch, accent, comp, flags) MAKELONG(ch, accent), comp, flags
386 
387 ROSDATA DEADKEY dead_key[] = {
388   { DEADTRANS(0x0061, 0x00a8, 0x00e4, 0x0000) },
389   { DEADTRANS(0x0065, 0x00a8, 0x00eb, 0x0000) },
390   { DEADTRANS(0x0069, 0x00a8, 0x00ef, 0x0000) },
391   { DEADTRANS(0x006f, 0x00a8, 0x00f6, 0x0000) },
392   { DEADTRANS(0x0075, 0x00a8, 0x00fc, 0x0000) },
393   { DEADTRANS(0x0079, 0x00a8, 0x00ff, 0x0000) },
394   { DEADTRANS(0x0041, 0x00a8, 0x00c4, 0x0000) },
395   { DEADTRANS(0x0045, 0x00a8, 0x00cb, 0x0000) },
396   { DEADTRANS(0x0049, 0x00a8, 0x00cf, 0x0000) },
397   { DEADTRANS(0x004f, 0x00a8, 0x00d6, 0x0000) },
398   { DEADTRANS(0x0055, 0x00a8, 0x00dc, 0x0000) },
399   { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) },
400 
401   { DEADTRANS(0x0061, 0x005e, 0x00e2, 0x0000) },
402   { DEADTRANS(0x0065, 0x005e, 0x00ea, 0x0000) },
403   { DEADTRANS(0x0069, 0x005e, 0x00ee, 0x0000) },
404   { DEADTRANS(0x006f, 0x005e, 0x00f4, 0x0000) },
405   { DEADTRANS(0x0075, 0x005e, 0x00fb, 0x0000) },
406   { DEADTRANS(0x0041, 0x005e, 0x00c2, 0x0000) },
407   { DEADTRANS(0x0045, 0x005e, 0x00ca, 0x0000) },
408   { DEADTRANS(0x0049, 0x005e, 0x00ce, 0x0000) },
409   { DEADTRANS(0x004f, 0x005e, 0x00d4, 0x0000) },
410   { DEADTRANS(0x0055, 0x005e, 0x00db, 0x0000) },
411   { DEADTRANS(0x0020, 0x005e, 0x005e, 0x0000) },
412 
413   { DEADTRANS(0x0061, 0x007e, 0x00e3, 0x0000) },
414   { DEADTRANS(0x006f, 0x007e, 0x00f5, 0x0000) },
415   { DEADTRANS(0x006e, 0x007e, 0x00f1, 0x0000) },
416   { DEADTRANS(0x0041, 0x007e, 0x00c3, 0x0000) },
417   { DEADTRANS(0x004f, 0x007e, 0x00d5, 0x0000) },
418   { DEADTRANS(0x004e, 0x007e, 0x00d1, 0x0000) },
419   { DEADTRANS(0x0020, 0x007e, 0x007e, 0x0000) },
420 
421   { DEADTRANS(0x0061, 0x00b4, 0x00e1, 0x0000) },
422   { DEADTRANS(0x0065, 0x00b4, 0x00e9, 0x0000) },
423   { DEADTRANS(0x0069, 0x00b4, 0x00ed, 0x0000) },
424   { DEADTRANS(0x006f, 0x00b4, 0x00f3, 0x0000) },
425   { DEADTRANS(0x0075, 0x00b4, 0x00fa, 0x0000) },
426   { DEADTRANS(0x0079, 0x00b4, 0x00fd, 0x0000) },
427   { DEADTRANS(0x0041, 0x00b4, 0x00c1, 0x0000) },
428   { DEADTRANS(0x0045, 0x00b4, 0x00c9, 0x0000) },
429   { DEADTRANS(0x0049, 0x00b4, 0x00cd, 0x0000) },
430   { DEADTRANS(0x004f, 0x00b4, 0x00d3, 0x0000) },
431   { DEADTRANS(0x0055, 0x00b4, 0x00da, 0x0000) },
432   { DEADTRANS(0x0059, 0x00b4, 0x00dd, 0x0000) },
433   { DEADTRANS(0x0020, 0x00b4, 0x00b4, 0x0000) },
434 
435   { DEADTRANS(0x0061, 0x0060, 0x00e0, 0x0000) },
436   { DEADTRANS(0x0065, 0x0060, 0x00e8, 0x0000) },
437   { DEADTRANS(0x0069, 0x0060, 0x00ec, 0x0000) },
438   { DEADTRANS(0x006f, 0x0060, 0x00f2, 0x0000) },
439   { DEADTRANS(0x0075, 0x0060, 0x00f9, 0x0000) },
440   { DEADTRANS(0x0041, 0x0060, 0x00c0, 0x0000) },
441   { DEADTRANS(0x0045, 0x0060, 0x00c8, 0x0000) },
442   { DEADTRANS(0x0049, 0x0060, 0x00cc, 0x0000) },
443   { DEADTRANS(0x004f, 0x0060, 0x00d2, 0x0000) },
444   { DEADTRANS(0x0055, 0x0060, 0x00d9, 0x0000) },
445   { DEADTRANS(0x0020, 0x0060, 0x0060, 0x0000) },
446   { 0, 0 }
447 };
448 
449 /* Finally, the master table */
450 ROSDATA KBDTABLES keyboard_layout_table = {
451   /* modifier assignments */
452   &modifier_bits,
453 
454   /* character from vk tables */
455   vk_to_wchar_master_table,
456 
457   /* diacritical marks -- currently implemented by wine code */
458   dead_key,
459 
460   /* Key names */
461   (VSC_LPWSTR *)key_names,
462   (VSC_LPWSTR *)extended_key_names,
463   dead_key_names, /* Dead key names */
464 
465   /* scan code to virtual key maps */
466   scancode_to_vk,
467   sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]),
468   extcode0_to_vk,
469   extcode1_to_vk,
470 
471   MAKELONG(1,1), /* Version 1.0 */
472 
473   /* Ligatures -- Swedish doesn't have any */
474   0,
475   0,
476   NULL
477 };
478 
479 PKBDTABLES WINAPI KbdLayerDescriptor(VOID) {
480   return &keyboard_layout_table;
481 }
482 
483 INT WINAPI
484 DllMain(
485   PVOID hinstDll,
486   ULONG dwReason,
487   PVOID reserved)
488 {
489   return 1;
490 }
491 
492