1 | /* $Id: winkeyboard.cpp,v 1.14 2001-07-15 14:58:12 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Win32 <-> PM key translation
|
---|
4 | *
|
---|
5 | *
|
---|
6 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
7 | *
|
---|
8 | */
|
---|
9 | #include <os2win.h>
|
---|
10 | #include <odin.h>
|
---|
11 | #include <string.h>
|
---|
12 | #include <stdio.h>
|
---|
13 | #include <winkeyboard.h>
|
---|
14 | #include "oslibwin.h"
|
---|
15 | #include <heapstring.h>
|
---|
16 | #include <pmscan.h>
|
---|
17 | #include <winuser32.h>
|
---|
18 | #include "initterm.h"
|
---|
19 |
|
---|
20 | #define DBG_LOCALLOG DBG_winkeyboard
|
---|
21 | #include "dbglocal.h"
|
---|
22 |
|
---|
23 | BOOL OPEN32API _O32_GetKeyboardState( PBYTE lpKeyState );
|
---|
24 |
|
---|
25 | inline BOOL O32_GetKeyboardState(PBYTE lpKeyState)
|
---|
26 | {
|
---|
27 | BOOL yyrc;
|
---|
28 | USHORT sel = RestoreOS2FS();
|
---|
29 |
|
---|
30 | yyrc = _O32_GetKeyboardState(lpKeyState);
|
---|
31 | SetFS(sel);
|
---|
32 |
|
---|
33 | return yyrc;
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 | BYTE abPMScanToWinVKey[256][2] =
|
---|
38 | /****************************************************************************/
|
---|
39 | /* PM Scancode * Win32 vkey Extended Key */
|
---|
40 | /****************************************************************************/
|
---|
41 | /* 0x00 */ { 0x00, FALSE
|
---|
42 | /* 0x01 PMSCAN_ESC */ , VK_ESCAPE ,FALSE
|
---|
43 | /* 0x02 PMSCAN_ONE */ , VK_1 ,FALSE
|
---|
44 | /* 0x03 PMSCAN_TWO */ , VK_2 ,FALSE
|
---|
45 | /* 0x04 PMSCAN_THREE */ , VK_3 ,FALSE
|
---|
46 | /* 0x05 PMSCAN_FOUR */ , VK_4 ,FALSE
|
---|
47 | /* 0x06 PMSCAN_FIVE */ , VK_5 ,FALSE
|
---|
48 | /* 0x07 PMSCAN_SIX */ , VK_6 ,FALSE
|
---|
49 | /* 0x08 PMSCAN_SEVEN */ , VK_7 ,FALSE
|
---|
50 | /* 0x09 PMSCAN_EIGHT */ , VK_8 ,FALSE
|
---|
51 | /* 0x0A PMSCAN_NINE */ , VK_9 ,FALSE
|
---|
52 | /* 0x0B PMSCAN_ZERO */ , VK_0 ,FALSE
|
---|
53 | /* 0x0C PMSCAN_HYPHEN */ , VK_HYPHEN ,FALSE
|
---|
54 | /* 0x0D PMSCAN_EQUAL */ , VK_EQUAL ,FALSE
|
---|
55 | /* 0x0E PMSCAN_BACKSPACE */ , VK_BACK ,FALSE
|
---|
56 | /* 0x0F PMSCAN_TAB */ , VK_TAB ,FALSE
|
---|
57 | /* 0x10 PMSCAN_Q */ , VK_Q ,FALSE
|
---|
58 | /* 0x11 PMSCAN_W */ , VK_W ,FALSE
|
---|
59 | /* 0x12 PMSCAN_E */ , VK_E ,FALSE
|
---|
60 | /* 0x13 PMSCAN_R */ , VK_R ,FALSE
|
---|
61 | /* 0x14 PMSCAN_T */ , VK_T ,FALSE
|
---|
62 | /* 0x15 PMSCAN_Y */ , VK_Y ,FALSE
|
---|
63 | /* 0x16 PMSCAN_U */ , VK_U ,FALSE
|
---|
64 | /* 0x17 PMSCAN_I */ , VK_I ,FALSE
|
---|
65 | /* 0x18 PMSCAN_O */ , VK_O ,FALSE
|
---|
66 | /* 0x19 PMSCAN_P */ , VK_P ,FALSE
|
---|
67 | /* 0x1A PMSCAN_BRACKETLEFT */ , VK_BRACKETLEFT ,FALSE
|
---|
68 | /* 0x1B PMSCAN_BRACKETRIGHT */ , VK_BRACKETRIGHT ,FALSE
|
---|
69 | /* 0x1C PMSCAN_ENTER */ , VK_RETURN ,FALSE
|
---|
70 | /* 0x1D PMSCAN_CTRLLEFT */ , VK_LCONTROL ,FALSE
|
---|
71 | /* 0x1E PMSCAN_A */ , VK_A ,FALSE
|
---|
72 | /* 0x1F PMSCAN_S */ , VK_S ,FALSE
|
---|
73 | /* 0x20 PMSCAN_D */ , VK_D ,FALSE
|
---|
74 | /* 0x21 PMSCAN_F */ , VK_F ,FALSE
|
---|
75 | /* 0x22 PMSCAN_G */ , VK_G ,FALSE
|
---|
76 | /* 0x23 PMSCAN_H */ , VK_H ,FALSE
|
---|
77 | /* 0x24 PMSCAN_J */ , VK_J ,FALSE
|
---|
78 | /* 0x25 PMSCAN_K */ , VK_K ,FALSE
|
---|
79 | /* 0x26 PMSCAN_L */ , VK_L ,FALSE
|
---|
80 | /* 0x27 PMSCAN_SEMICOLON */ , VK_SEMICOLON ,FALSE
|
---|
81 | /* 0x28 PMSCAN_QUOTESINGLE */ , VK_QUOTESINGLE ,FALSE
|
---|
82 | /* 0x29 PMSCAN_GRAVE */ , VK_GRAVE ,FALSE
|
---|
83 | /* 0x2A PMSCAN_SHIFTLEFT */ , VK_LSHIFT ,FALSE
|
---|
84 | /* 0x2B PMSCAN_BACKSLASH */ , VK_BACKSLASH ,FALSE
|
---|
85 | /* 0x2C PMSCAN_Z */ , VK_Z ,FALSE
|
---|
86 | /* 0x2D PMSCAN_X */ , VK_X ,FALSE
|
---|
87 | /* 0x2E PMSCAN_C */ , VK_C ,FALSE
|
---|
88 | /* 0x2F PMSCAN_V */ , VK_V ,FALSE
|
---|
89 | /* 0x30 PMSCAN_B */ , VK_B ,FALSE
|
---|
90 | /* 0x31 PMSCAN_N */ , VK_N ,FALSE
|
---|
91 | /* 0x32 PMSCAN_M */ , VK_M ,FALSE
|
---|
92 | /* 0x33 PMSCAN_COMMA */ , VK_COMMA ,FALSE
|
---|
93 | /* 0x34 PMSCAN_PERIOD */ , VK_PERIOD ,FALSE
|
---|
94 | /* 0x35 PMSCAN_SLASH */ , VK_SLASH ,FALSE
|
---|
95 | /* 0x36 PMSCAN_SHIFTRIGHT */ , VK_RSHIFT ,FALSE
|
---|
96 | /* 0x37 PMSCAN_PADASTERISK */ , VK_MULTIPLY ,FALSE
|
---|
97 | /* 0x38 PMSCAN_ALTLEFT */ , VK_LMENU ,FALSE
|
---|
98 | /* 0x39 PMSCAN_SPACE */ , VK_SPACE ,FALSE
|
---|
99 | /* 0x3A PMSCAN_CAPSLOCK */ , VK_CAPITAL ,FALSE
|
---|
100 | /* 0x3B PMSCAN_F1 */ , VK_F1 ,FALSE
|
---|
101 | /* 0x3C PMSCAN_F2 */ , VK_F2 ,FALSE
|
---|
102 | /* 0x3D PMSCAN_F3 */ , VK_F3 ,FALSE
|
---|
103 | /* 0x3E PMSCAN_F4 */ , VK_F4 ,FALSE
|
---|
104 | /* 0x3F PMSCAN_F5 */ , VK_F5 ,FALSE
|
---|
105 | /* 0x40 PMSCAN_F6 */ , VK_F6 ,FALSE
|
---|
106 | /* 0x41 PMSCAN_F7 */ , VK_F7 ,FALSE
|
---|
107 | /* 0x42 PMSCAN_F8 */ , VK_F8 ,FALSE
|
---|
108 | /* 0x43 PMSCAN_F9 */ , VK_F9 ,FALSE
|
---|
109 | /* 0x44 PMSCAN_F10 */ , VK_F10 ,FALSE
|
---|
110 | /* 0x45 PMSCAN_NUMLOCK */ , VK_NUMLOCK ,TRUE
|
---|
111 | /* 0x46 PMSCAN_SCROLLLOCK */ , VK_SCROLL ,FALSE
|
---|
112 | /* 0x47 PMSCAN_PAD7 */ , VK_NUMPAD7 ,FALSE
|
---|
113 | /* 0x48 PMSCAN_PAD8 */ , VK_NUMPAD8 ,FALSE
|
---|
114 | /* 0x49 PMSCAN_PAD9 */ , VK_NUMPAD9 ,FALSE
|
---|
115 | /* 0x4A PMSCAN_PADMINUS */ , VK_SUBTRACT ,FALSE
|
---|
116 | /* 0x4B PMSCAN_PAD4 */ , VK_NUMPAD4 ,FALSE
|
---|
117 | /* 0x4C PMSCAN_PAD5 */ , VK_NUMPAD5 ,FALSE
|
---|
118 | /* 0x4D PMSCAN_PAD6 */ , VK_NUMPAD6 ,FALSE
|
---|
119 | /* 0x4E PMSCAN_PADPLUS */ , VK_ADD ,FALSE
|
---|
120 | /* 0x4F PMSCAN_PAD1 */ , VK_NUMPAD1 ,FALSE
|
---|
121 | /* 0x50 PMSCAN_PAD2 */ , VK_NUMPAD2 ,FALSE
|
---|
122 | /* 0x51 PMSCAN_PAD3 */ , VK_NUMPAD3 ,FALSE
|
---|
123 | /* 0x52 PMSCAN_PAD0 */ , VK_NUMPAD0 ,FALSE
|
---|
124 | /* 0x53 PMSCAN_PADPERIOD */ , VK_DECIMAL ,FALSE
|
---|
125 | /* 0x54 PMSCAN_SYSREQ */ , 0x00 ,FALSE
|
---|
126 | /* 0x55 PMSCAN_RESET */ , 0x00 ,FALSE
|
---|
127 | /* 0x56 PMSCAN_EXTRA */ , VK_EXTRA ,FALSE
|
---|
128 | /* 0x57 PMSCAN_F11 */ , VK_F11 ,FALSE
|
---|
129 | /* 0x58 PMSCAN_F12 */ , VK_F12 ,FALSE
|
---|
130 | /* 0x59 PMSCAN_BACKTAB */ , 0x00 ,FALSE
|
---|
131 | /* 0x5A PMSCAN_PADENTER */ , VK_RETURN ,TRUE
|
---|
132 | /* 0x5B PMSCAN_CTRLRIGHT */ , VK_CONTROL ,TRUE
|
---|
133 | /* 0x5C PMSCAN_PADSLASH */ , VK_DIVIDE ,TRUE
|
---|
134 | /* 0x5D PMSCAN_PRINT */ , VK_PRINT ,FALSE
|
---|
135 | /* 0x5E PMSCAN_ALTRIGHT */ , VK_RMENU ,TRUE
|
---|
136 | /* 0x5F PMSCAN_PAUSE */ , VK_PAUSE ,FALSE
|
---|
137 | /* 0x60 PMSCAN_HOME */ , VK_HOME ,TRUE
|
---|
138 | /* 0x61 PMSCAN_UP */ , VK_UP ,TRUE
|
---|
139 | /* 0x62 PMSCAN_PAGEUP */ , VK_PRIOR ,TRUE
|
---|
140 | /* 0x63 PMSCAN_LEFT */ , VK_LEFT ,TRUE
|
---|
141 | /* 0x64 PMSCAN_RIGHT */ , VK_RIGHT ,TRUE
|
---|
142 | /* 0x65 PMSCAN_END */ , VK_END ,TRUE
|
---|
143 | /* 0x66 PMSCAN_DOWN */ , VK_DOWN ,TRUE
|
---|
144 | /* 0x67 PMSCAN_PAGEDOWN */ , VK_NEXT ,TRUE
|
---|
145 | /* 0x68 PMSCAN_INSERT */ , VK_INSERT ,TRUE
|
---|
146 | /* 0x69 PMSCAN_DELETE */ , VK_DELETE ,TRUE
|
---|
147 | /* 0x6A PMSCAN_F23 */ , VK_F23 ,FALSE
|
---|
148 | /* 0x6B PMSCAN_F24 */ , VK_F24 ,FALSE
|
---|
149 | /* 0x6C PMSCAN_SYSMEM */ , 0x00 ,FALSE
|
---|
150 | /* 0x6D PMSCAN_ERASEEOF */ , VK_EREOF ,FALSE
|
---|
151 | /* 0x6E PMSCAN_BREAK */ , VK_CANCEL ,TRUE
|
---|
152 | /* 0x6F PMSCAN_MOVEWIN */ , 0x00 ,FALSE
|
---|
153 | /* 0x70 PMSCAN_NLS3 */ , 0x00 ,FALSE
|
---|
154 | /* 0x71 PMSCAN_HELP */ , VK_HELP ,FALSE
|
---|
155 | /* 0x72 PMSCAN_TASKMAN */ , 0x00 ,FALSE
|
---|
156 | /* 0x73 PMSCAN_B11 */ , 0x00 ,FALSE
|
---|
157 | /* 0x74 PMSCAN_JUMP */ , 0x00 ,FALSE
|
---|
158 | /* 0x75 PMSCAN_MINWIN */ , 0x00 ,FALSE
|
---|
159 | /* 0x76 PMSCAN_CLEAR */ , 0x00 ,FALSE
|
---|
160 | /* 0x77 PMSCAN_77 */ , 0x00 ,FALSE
|
---|
161 | /* 0x78 PMSCAN_78 */ , 0x00 ,FALSE
|
---|
162 | /* 0x79 PMSCAN_NLS2 */ , 0x00 ,FALSE
|
---|
163 | /* 0x7a PMSCAN_SIZE */ , 0x00 ,FALSE
|
---|
164 | /* 0x7b PMSCAN_NLS1 */ , 0x00 ,FALSE
|
---|
165 | /* 0x7c PMSCAN_APPLICATION */ , VK_APPS ,FALSE
|
---|
166 | /* 0x7d PMSCAN_E13 */ , 0x00 ,FALSE
|
---|
167 | /* 0x7e PMSCAN */ , 0x00 ,FALSE
|
---|
168 | /* 0x7f PMSCAN */ , 0x00 ,FALSE
|
---|
169 | /* 0x80 PMSCAN_PA1 */ , VK_PA1 ,FALSE
|
---|
170 | /* 0x81 PMSCAN_F13 */ , VK_F13 ,FALSE
|
---|
171 | /* 0x82 PMSCAN_F14 */ , VK_F14 ,FALSE
|
---|
172 | /* 0x83 PMSCAN_F15 */ , VK_F15 ,FALSE
|
---|
173 | /* 0x84 PMSCAN_PA2 */ , 0x00 ,FALSE
|
---|
174 | /* 0x85 PMSCAN_PA3 */ , 0x00 ,FALSE
|
---|
175 | /* 0x86 PMSCAN_SPACEBREAK */ , 0x00 ,FALSE
|
---|
176 | /* 0x87 PMSCAN_TABRIGHT */ , 0x00 ,FALSE
|
---|
177 | /* 0x88 PMSCAN_NOOP */ , 0x00 ,FALSE
|
---|
178 | /* 0x89 PMSCAN_F16 */ , VK_F16 ,FALSE
|
---|
179 | /* 0x8a PMSCAN_F17 */ , VK_F17 ,FALSE
|
---|
180 | /* 0x8b PMSCAN_F18 */ , VK_F18 ,FALSE
|
---|
181 | /* 0x8c PMSCAN_F19 */ , VK_F19 ,FALSE
|
---|
182 | /* 0x8d PMSCAN_F20 */ , VK_F20 ,FALSE
|
---|
183 | /* 0x8e PMSCAN_F21 */ , VK_F21 ,FALSE
|
---|
184 | /* 0x8f PMSCAN_F22 */ , VK_F22 ,FALSE
|
---|
185 | /* 0x90 */ , 0x00 ,FALSE
|
---|
186 | /* 0x91 */ , 0x00 ,FALSE
|
---|
187 | /* 0x92 */ , 0x00 ,FALSE
|
---|
188 | /* 0x93 */ , 0x00 ,FALSE
|
---|
189 | /* 0x94 */ , 0x00 ,FALSE
|
---|
190 | /* 0x95 */ , 0x00 ,FALSE
|
---|
191 | /* 0x96 */ , 0x00 ,FALSE
|
---|
192 | /* 0x97 */ , 0x00 ,FALSE
|
---|
193 | /* 0x98 */ , 0x00 ,FALSE
|
---|
194 | /* 0x99 */ , 0x00 ,FALSE
|
---|
195 | /* 0x9A */ , 0x00 ,FALSE
|
---|
196 | /* 0x9B */ , 0x00 ,FALSE
|
---|
197 | /* 0x9C */ , 0x00 ,FALSE
|
---|
198 | /* 0x9D */ , 0x00 ,FALSE
|
---|
199 | /* 0x9E */ , 0x00 ,FALSE
|
---|
200 | /* 0x9F */ , 0x00 ,FALSE
|
---|
201 | /* 0xA0 */ , 0x00 ,FALSE
|
---|
202 | /* 0xA1 */ , 0x00 ,FALSE
|
---|
203 | /* 0xA2 */ , 0x00 ,FALSE
|
---|
204 | /* 0xA3 */ , 0x00 ,FALSE
|
---|
205 | /* 0xA4 */ , 0x00 ,FALSE
|
---|
206 | /* 0xA5 */ , 0x00 ,FALSE
|
---|
207 | /* 0xA6 */ , 0x00 ,FALSE
|
---|
208 | /* 0xA7 */ , 0x00 ,FALSE
|
---|
209 | /* 0xA8 */ , 0x00 ,FALSE
|
---|
210 | /* 0xA9 */ , 0x00 ,FALSE
|
---|
211 | /* 0xAA */ , 0x00 ,FALSE
|
---|
212 | /* 0xAB */ , 0x00 ,FALSE
|
---|
213 | /* 0xAC */ , 0x00 ,FALSE
|
---|
214 | /* 0xAD */ , 0x00 ,FALSE
|
---|
215 | /* 0xAE */ , 0x00 ,FALSE
|
---|
216 | /* 0xAF */ , 0x00 ,FALSE
|
---|
217 | /* 0xB0 */ , 0x00 ,FALSE
|
---|
218 | /* 0xB1 */ , 0x00 ,FALSE
|
---|
219 | /* 0xB2 */ , 0x00 ,FALSE
|
---|
220 | /* 0xB3 */ , 0x00 ,FALSE
|
---|
221 | /* 0xB4 */ , 0x00 ,FALSE
|
---|
222 | /* 0xB5 */ , 0x00 ,FALSE
|
---|
223 | /* 0xB6 */ , 0x00 ,FALSE
|
---|
224 | /* 0xB7 */ , 0x00 ,FALSE
|
---|
225 | /* 0xB8 */ , 0x00 ,FALSE
|
---|
226 | /* 0xB9 */ , 0x00 ,FALSE
|
---|
227 | /* 0xBA */ , 0x00 ,FALSE
|
---|
228 | /* 0xBB */ , 0x00 ,FALSE
|
---|
229 | /* 0xBC */ , 0x00 ,FALSE
|
---|
230 | /* 0xBD */ , 0x00 ,FALSE
|
---|
231 | /* 0xBE */ , 0x00 ,FALSE
|
---|
232 | /* 0xBF */ , 0x00 ,FALSE
|
---|
233 | /* 0xC0 */ , 0x00 ,FALSE
|
---|
234 | /* 0xC1 */ , 0x00 ,FALSE
|
---|
235 | /* 0xC2 */ , 0x00 ,FALSE
|
---|
236 | /* 0xC3 */ , 0x00 ,FALSE
|
---|
237 | /* 0xC4 */ , 0x00 ,FALSE
|
---|
238 | /* 0xC5 */ , 0x00 ,FALSE
|
---|
239 | /* 0xC6 */ , 0x00 ,FALSE
|
---|
240 | /* 0xC7 */ , 0x00 ,FALSE
|
---|
241 | /* 0xC8 */ , 0x00 ,FALSE
|
---|
242 | /* 0xC9 */ , 0x00 ,FALSE
|
---|
243 | /* 0xCA */ , 0x00 ,FALSE
|
---|
244 | /* 0xCB */ , 0x00 ,FALSE
|
---|
245 | /* 0xCC */ , 0x00 ,FALSE
|
---|
246 | /* 0xCD */ , 0x00 ,FALSE
|
---|
247 | /* 0xCE */ , 0x00 ,FALSE
|
---|
248 | /* 0xCF */ , 0x00 ,FALSE
|
---|
249 | /* 0xD0 */ , 0x00 ,FALSE
|
---|
250 | /* 0xD1 */ , 0x00 ,FALSE
|
---|
251 | /* 0xD2 */ , 0x00 ,FALSE
|
---|
252 | /* 0xD3 */ , 0x00 ,FALSE
|
---|
253 | /* 0xD4 */ , 0x00 ,FALSE
|
---|
254 | /* 0xD5 */ , 0x00 ,FALSE
|
---|
255 | /* 0xD6 */ , 0x00 ,FALSE
|
---|
256 | /* 0xD7 */ , 0x00 ,FALSE
|
---|
257 | /* 0xD8 */ , 0x00 ,FALSE
|
---|
258 | /* 0xD9 */ , 0x00 ,FALSE
|
---|
259 | /* 0xDA */ , 0x00 ,FALSE
|
---|
260 | /* 0xDB */ , 0x00 ,FALSE
|
---|
261 | /* 0xDC */ , 0x00 ,FALSE
|
---|
262 | /* 0xDD */ , 0x00 ,FALSE
|
---|
263 | /* 0xDE */ , 0x00 ,FALSE
|
---|
264 | /* 0xDF */ , 0x00 ,FALSE
|
---|
265 | /* 0xE0 */ , 0x00 ,FALSE
|
---|
266 | /* 0xE1 */ , 0x00 ,FALSE
|
---|
267 | /* 0xE2 */ , 0x00 ,FALSE
|
---|
268 | /* 0xE3 */ , 0x00 ,FALSE
|
---|
269 | /* 0xE4 */ , 0x00 ,FALSE
|
---|
270 | /* 0xE5 */ , 0x00 ,FALSE
|
---|
271 | /* 0xE6 */ , 0x00 ,FALSE
|
---|
272 | /* 0xE7 */ , 0x00 ,FALSE
|
---|
273 | /* 0xE8 */ , 0x00 ,FALSE
|
---|
274 | /* 0xE9 */ , 0x00 ,FALSE
|
---|
275 | /* 0xEA */ , 0x00 ,FALSE
|
---|
276 | /* 0xEB */ , 0x00 ,FALSE
|
---|
277 | /* 0xEC */ , 0x00 ,FALSE
|
---|
278 | /* 0xED */ , 0x00 ,FALSE
|
---|
279 | /* 0xEE */ , 0x00 ,FALSE
|
---|
280 | /* 0xEF */ , 0x00 ,FALSE
|
---|
281 | /* 0xF0 */ , 0x00 ,FALSE
|
---|
282 | /* 0xF1 */ , 0x00 ,FALSE
|
---|
283 | /* 0xF2 */ , 0x00 ,FALSE
|
---|
284 | /* 0xF3 */ , 0x00 ,FALSE
|
---|
285 | /* 0xF4 */ , 0x00 ,FALSE
|
---|
286 | /* 0xF5 */ , 0x00 ,FALSE
|
---|
287 | /* 0xF6 */ , 0x00 ,FALSE
|
---|
288 | /* 0xF7 */ , 0x00 ,FALSE
|
---|
289 | /* 0xF8 */ , 0x00 ,FALSE
|
---|
290 | /* 0xF9 */ , 0x00 ,FALSE
|
---|
291 | /* 0xFA */ , 0x00 ,FALSE
|
---|
292 | /* 0xFB */ , 0x00 ,FALSE
|
---|
293 | /* 0xFC */ , 0x00 ,FALSE
|
---|
294 | /* 0xFD */ , 0x00 ,FALSE
|
---|
295 | /* 0xFE */ , 0x00 ,FALSE
|
---|
296 | /* 0xFF */ , 0x00 ,FALSE
|
---|
297 | };
|
---|
298 |
|
---|
299 | BYTE abWinVKeyToPMScan[256] =
|
---|
300 | /****************************************/
|
---|
301 | /* Vkey * Scancode */
|
---|
302 | /****************************************/
|
---|
303 | /* 0x00 */ { 0x00
|
---|
304 | /* 0x01 VK_LBUTTON */ , 0x00
|
---|
305 | /* 0x02 VK_RBUTTON */ , 0x00
|
---|
306 | /* 0x03 VK_CANCEL */ , PMSCAN_BREAK
|
---|
307 | /* 0x04 VK_MBUTTON */ , 0x00
|
---|
308 | /* 0x05 */ , 0x00
|
---|
309 | /* 0x06 */ , 0x00
|
---|
310 | /* 0x07 */ , 0x00
|
---|
311 | /* 0x08 VK_BACK */ , PMSCAN_BACKSPACE
|
---|
312 | /* 0x09 VK_TAB */ , PMSCAN_TAB
|
---|
313 | /* 0x0A */ , 0x00
|
---|
314 | /* 0x0B */ , 0x00
|
---|
315 | /* 0x0C VK_CLEAR */ , PMSCAN_PAD5
|
---|
316 | /* 0x0D VK_RETURN */ , PMSCAN_ENTER
|
---|
317 | /* 0x0E */ , 0x00
|
---|
318 | /* 0x0F */ , 0x00
|
---|
319 | /* 0x10 VK_SHIFT */ , PMSCAN_SHIFTLEFT
|
---|
320 | /* 0x11 VK_CONTROL */ , PMSCAN_CTRLLEFT
|
---|
321 | /* 0x12 VK_MENU */ , PMSCAN_ALTLEFT
|
---|
322 | /* 0x13 VK_PAUSE */ , PMSCAN_PAUSE
|
---|
323 | /* 0x14 VK_CAPITAL */ , PMSCAN_CAPSLOCK
|
---|
324 | /* 0x15 */ , 0x00
|
---|
325 | /* 0x16 */ , 0x00
|
---|
326 | /* 0x17 */ , 0x00
|
---|
327 | /* 0x18 */ , 0x00
|
---|
328 | /* 0x19 */ , 0x00
|
---|
329 | /* 0x1A */ , 0x00
|
---|
330 | /* 0x1B VK_ESCAPE */ , PMSCAN_ESC
|
---|
331 | /* 0x1C */ , 0x00
|
---|
332 | /* 0x1D */ , 0x00
|
---|
333 | /* 0x1E */ , 0x00
|
---|
334 | /* 0x1F */ , 0x00
|
---|
335 | /* 0x20 VK_SPACE */ , PMSCAN_SPACE
|
---|
336 | /* 0x21 VK_PRIOR */ , PMSCAN_PAGEUP
|
---|
337 | /* 0x22 VK_NEXT */ , PMSCAN_PAGEDOWN
|
---|
338 | /* 0x23 VK_END */ , PMSCAN_END
|
---|
339 | /* 0x24 VK_HOME */ , PMSCAN_HOME
|
---|
340 | /* 0x25 VK_LEFT */ , PMSCAN_LEFT
|
---|
341 | /* 0x26 VK_UP */ , PMSCAN_UP
|
---|
342 | /* 0x27 VK_RIGHT */ , PMSCAN_RIGHT
|
---|
343 | /* 0x28 VK_DOWN */ , PMSCAN_DOWN
|
---|
344 | /* 0x29 VK_SELECT */ , 0x00
|
---|
345 | /* 0x2A VK_PRINT */ , PMSCAN_PRINT
|
---|
346 | /* 0x2B VK_EXECUTE */ , 0x00
|
---|
347 | /* 0x2C VK_SNAPSHOT */ , 0x00
|
---|
348 | /* 0x2D VK_INSERT */ , PMSCAN_INSERT
|
---|
349 | /* 0x2E VK_DELETE */ , PMSCAN_DELETE
|
---|
350 | /* 0x2F VK_HELP */ , PMSCAN_HELP
|
---|
351 | /* 0x30 VK_0 */ , PMSCAN_ZERO
|
---|
352 | /* 0x31 VK_1 */ , PMSCAN_ONE
|
---|
353 | /* 0x32 VK_2 */ , PMSCAN_TWO
|
---|
354 | /* 0x33 VK_3 */ , PMSCAN_THREE
|
---|
355 | /* 0x34 VK_4 */ , PMSCAN_FOUR
|
---|
356 | /* 0x35 VK_5 */ , PMSCAN_FIVE
|
---|
357 | /* 0x36 VK_6 */ , PMSCAN_SIX
|
---|
358 | /* 0x37 VK_7 */ , PMSCAN_SEVEN
|
---|
359 | /* 0x38 VK_8 */ , PMSCAN_EIGHT
|
---|
360 | /* 0x39 VK_9 */ , PMSCAN_NINE
|
---|
361 | /* 0x3A */ , 0x00
|
---|
362 | /* 0x3B */ , 0x00
|
---|
363 | /* 0x3C */ , 0x00
|
---|
364 | /* 0x3D */ , 0x00
|
---|
365 | /* 0x3E */ , 0x00
|
---|
366 | /* 0x3F */ , 0x00
|
---|
367 | /* 0x40 */ , 0x00
|
---|
368 | /* 0x41 VK_A */ , PMSCAN_A
|
---|
369 | /* 0x42 VK_B */ , PMSCAN_B
|
---|
370 | /* 0x43 VK_C */ , PMSCAN_C
|
---|
371 | /* 0x44 VK_D */ , PMSCAN_D
|
---|
372 | /* 0x45 VK_E */ , PMSCAN_E
|
---|
373 | /* 0x46 VK_F */ , PMSCAN_F
|
---|
374 | /* 0x47 VK_G */ , PMSCAN_G
|
---|
375 | /* 0x48 VK_H */ , PMSCAN_H
|
---|
376 | /* 0x49 VK_I */ , PMSCAN_I
|
---|
377 | /* 0x4A VK_J */ , PMSCAN_J
|
---|
378 | /* 0x4B VK_K */ , PMSCAN_K
|
---|
379 | /* 0x4C VK_L */ , PMSCAN_L
|
---|
380 | /* 0x4D VK_M */ , PMSCAN_M
|
---|
381 | /* 0x4E VK_N */ , PMSCAN_N
|
---|
382 | /* 0x4F VK_O */ , PMSCAN_O
|
---|
383 | /* 0x50 VK_P */ , PMSCAN_P
|
---|
384 | /* 0x51 VK_Q */ , PMSCAN_Q
|
---|
385 | /* 0x52 VK_R */ , PMSCAN_R
|
---|
386 | /* 0x53 VK_S */ , PMSCAN_S
|
---|
387 | /* 0x54 VK_T */ , PMSCAN_T
|
---|
388 | /* 0x55 VK_U */ , PMSCAN_U
|
---|
389 | /* 0x56 VK_V */ , PMSCAN_V
|
---|
390 | /* 0x57 VK */ , PMSCAN_W
|
---|
391 | /* 0x58 VK_X */ , PMSCAN_X
|
---|
392 | /* 0x59 VK_Y */ , PMSCAN_Y
|
---|
393 | /* 0x5A VK_Z */ , PMSCAN_Z
|
---|
394 | /* 0x5B VK_LWIN */ , PMSCAN_WINLEFT
|
---|
395 | /* 0x5C VK_RWIN */ , PMSCAN_WINRIGHT
|
---|
396 | /* 0x5D VK_APPS */ , PMSCAN_APPLICATION
|
---|
397 | /* 0x5E */ , 0x00
|
---|
398 | /* 0x5F */ , 0x00
|
---|
399 | /* 0x60 VK_NUMPAD0 */ , PMSCAN_PAD0
|
---|
400 | /* 0x61 VK_NUMPAD1 */ , PMSCAN_PAD1
|
---|
401 | /* 0x62 VK_NUMPAD2 */ , PMSCAN_PAD2
|
---|
402 | /* 0x63 VK_NUMPAD3 */ , PMSCAN_PAD3
|
---|
403 | /* 0x64 VK_NUMPAD4 */ , PMSCAN_PAD4
|
---|
404 | /* 0x65 VK_NUMPAD5 */ , PMSCAN_PAD5
|
---|
405 | /* 0x66 VK_NUMPAD6 */ , PMSCAN_PAD6
|
---|
406 | /* 0x67 VK_NUMPAD7 */ , PMSCAN_PAD7
|
---|
407 | /* 0x68 VK_NUMPAD8 */ , PMSCAN_PAD8
|
---|
408 | /* 0x69 VK_NUMPAD9 */ , PMSCAN_PAD9
|
---|
409 | /* 0x6A VK_MULTIPLY */ , PMSCAN_PADASTERISK
|
---|
410 | /* 0x6B VK_ADD */ , PMSCAN_PADPLUS
|
---|
411 | /* 0x6C VK_SEPARATOR */ , 0x00
|
---|
412 | /* 0x6D VK_SUBTRACT */ , PMSCAN_PADMINUS
|
---|
413 | /* 0x6E VK_DECIMAL */ , PMSCAN_PADPERIOD
|
---|
414 | /* 0x6F VK_DIVIDE */ , PMSCAN_PADSLASH
|
---|
415 | /* 0x70 VK_F1 */ , PMSCAN_F1
|
---|
416 | /* 0x71 VK_F2 */ , PMSCAN_F2
|
---|
417 | /* 0x72 VK_F3 */ , PMSCAN_F3
|
---|
418 | /* 0x73 VK_F4 */ , PMSCAN_F4
|
---|
419 | /* 0x74 VK_F5 */ , PMSCAN_F5
|
---|
420 | /* 0x75 VK_F6 */ , PMSCAN_F6
|
---|
421 | /* 0x76 VK_F7 */ , PMSCAN_F7
|
---|
422 | /* 0x77 VK_F8 */ , PMSCAN_F8
|
---|
423 | /* 0x78 VK_F9 */ , PMSCAN_F9
|
---|
424 | /* 0x79 VK_F10 */ , PMSCAN_F10
|
---|
425 | /* 0x7A VK_F11 */ , PMSCAN_F11
|
---|
426 | /* 0x7B VK_F12 */ , PMSCAN_F12
|
---|
427 | /* 0x7C VK_F13 */ , PMSCAN_F13
|
---|
428 | /* 0x7D VK_F14 */ , PMSCAN_F14
|
---|
429 | /* 0x7E VK_F15 */ , PMSCAN_F15
|
---|
430 | /* 0x7F VK_F16 */ , PMSCAN_F16
|
---|
431 | /* 0x80 VK_F17 */ , PMSCAN_F17
|
---|
432 | /* 0x81 VK_F18 */ , PMSCAN_F18
|
---|
433 | /* 0x82 VK_F19 */ , PMSCAN_F19
|
---|
434 | /* 0x83 VK_F20 */ , PMSCAN_F20
|
---|
435 | /* 0x84 VK_F21 */ , PMSCAN_F21
|
---|
436 | /* 0x85 VK_F22 */ , PMSCAN_F22
|
---|
437 | /* 0x86 VK_F23 */ , PMSCAN_F23
|
---|
438 | /* 0x87 VK_F24 */ , PMSCAN_F24
|
---|
439 | /* 0x88 */ , 0x00
|
---|
440 | /* 0x89 */ , 0x00
|
---|
441 | /* 0x8A */ , 0x00
|
---|
442 | /* 0x8B */ , 0x00
|
---|
443 | /* 0x8C */ , 0x00
|
---|
444 | /* 0x8D */ , 0x00
|
---|
445 | /* 0x8E */ , 0x00
|
---|
446 | /* 0x8F */ , 0x00
|
---|
447 | /* 0x90 VK_NUMLOCK */ , PMSCAN_NUMLOCK
|
---|
448 | /* 0x91 VK_SCROLL */ , PMSCAN_SCROLLLOCK
|
---|
449 | /* 0x92 */ , 0x00
|
---|
450 | /* 0x93 */ , 0x00
|
---|
451 | /* 0x94 */ , 0x00
|
---|
452 | /* 0x95 */ , 0x00
|
---|
453 | /* 0x96 */ , 0x00
|
---|
454 | /* 0x97 */ , 0x00
|
---|
455 | /* 0x98 */ , 0x00
|
---|
456 | /* 0x99 */ , 0x00
|
---|
457 | /* 0x9A */ , 0x00
|
---|
458 | /* 0x9B */ , 0x00
|
---|
459 | /* 0x9C */ , 0x00
|
---|
460 | /* 0x9D */ , 0x00
|
---|
461 | /* 0x9E */ , 0x00
|
---|
462 | /* 0x9F */ , 0x00
|
---|
463 | /* 0xA0 VK_LSHIFT */ , PMSCAN_SHIFTLEFT
|
---|
464 | /* 0xA1 VK_RSHIFT */ , PMSCAN_SHIFTRIGHT
|
---|
465 | /* 0xA2 VK_LCONTROL */ , PMSCAN_CTRLLEFT
|
---|
466 | /* 0xA3 VK_RCONTROL */ , PMSCAN_CTRLRIGHT
|
---|
467 | /* 0xA4 VK_LMENU */ , PMSCAN_ALTLEFT
|
---|
468 | /* 0xA5 VK_RMENU */ , PMSCAN_ALTRIGHT
|
---|
469 | /* 0xA6 */ , 0x00
|
---|
470 | /* 0xA7 */ , 0x00
|
---|
471 | /* 0xA8 */ , 0x00
|
---|
472 | /* 0xA9 */ , 0x00
|
---|
473 | /* 0xAA */ , 0x00
|
---|
474 | /* 0xAB */ , 0x00
|
---|
475 | /* 0xAC */ , 0x00
|
---|
476 | /* 0xAD */ , 0x00
|
---|
477 | /* 0xAE */ , 0x00
|
---|
478 | /* 0xAF */ , 0x00
|
---|
479 | /* 0xB0 */ , 0x00
|
---|
480 | /* 0xB1 */ , 0x00
|
---|
481 | /* 0xB2 */ , 0x00
|
---|
482 | /* 0xB3 */ , 0x00
|
---|
483 | /* 0xB4 */ , 0x00
|
---|
484 | /* 0xB5 */ , 0x00
|
---|
485 | /* 0xB6 */ , 0x00
|
---|
486 | /* 0xB7 */ , 0x00
|
---|
487 | /* 0xB8 */ , 0x00
|
---|
488 | /* 0xB9 */ , 0x00
|
---|
489 | /* 0xBA VK_SEMICOLON */ , PMSCAN_SEMICOLON
|
---|
490 | /* 0xBB VK_EQUAL */ , PMSCAN_EQUAL
|
---|
491 | /* 0xBC VK_COMMA */ , PMSCAN_COMMA
|
---|
492 | /* 0xBD VK_HYPHEN */ , PMSCAN_HYPHEN
|
---|
493 | /* 0xBE VK_PERIOD */ , PMSCAN_PERIOD
|
---|
494 | /* 0xBF VK_SLASH */ , PMSCAN_SLASH
|
---|
495 | /* 0xC0 VK_GRAVE */ , PMSCAN_GRAVE
|
---|
496 | /* 0xC1 VK_FFC1 */ , PMSCAN_JEXTRA
|
---|
497 | /* 0xC2 VK_YEN */ , PMSCAN_YEN
|
---|
498 | /* 0xC3 */ , 0x00
|
---|
499 | /* 0xC4 */ , 0x00
|
---|
500 | /* 0xC5 */ , 0x00
|
---|
501 | /* 0xC6 */ , 0x00
|
---|
502 | /* 0xC7 */ , 0x00
|
---|
503 | /* 0xC8 */ , 0x00
|
---|
504 | /* 0xC9 */ , 0x00
|
---|
505 | /* 0xCA */ , 0x00
|
---|
506 | /* 0xCB */ , 0x00
|
---|
507 | /* 0xCC */ , 0x00
|
---|
508 | /* 0xCD */ , 0x00
|
---|
509 | /* 0xCE */ , 0x00
|
---|
510 | /* 0xCF */ , 0x00
|
---|
511 | /* 0xD0 */ , 0x00
|
---|
512 | /* 0xD1 */ , 0x00
|
---|
513 | /* 0xD2 */ , 0x00
|
---|
514 | /* 0xD3 */ , 0x00
|
---|
515 | /* 0xD4 */ , 0x00
|
---|
516 | /* 0xD5 */ , 0x00
|
---|
517 | /* 0xD6 */ , 0x00
|
---|
518 | /* 0xD7 */ , 0x00
|
---|
519 | /* 0xD8 */ , 0x00
|
---|
520 | /* 0xD9 */ , 0x00
|
---|
521 | /* 0xDA */ , 0x00
|
---|
522 | /* 0xDB VK_BRACKETLEFT */ , PMSCAN_BRACKETLEFT
|
---|
523 | /* 0xDC VK_BACKSLASH */ , PMSCAN_BACKSLASH
|
---|
524 | /* 0xDD VK_BRACKETRIGHT */ , PMSCAN_BRACKETRIGHT
|
---|
525 | /* 0xDE VK_QUOTESINGLE */ , PMSCAN_QUOTESINGLE
|
---|
526 | /* 0xDF */ , 0x00
|
---|
527 | /* 0xE0 */ , 0x00
|
---|
528 | /* 0xE1 */ , 0x00
|
---|
529 | /* 0xE2 VK_EXTRA */ , PMSCAN_EXTRA
|
---|
530 | /* 0xE3 */ , 0x00
|
---|
531 | /* 0xE4 */ , 0x00
|
---|
532 | /* 0xE5 */ , 0x00
|
---|
533 | /* 0xE6 */ , 0x00
|
---|
534 | /* 0xE7 */ , 0x00
|
---|
535 | /* 0xE8 */ , 0x00
|
---|
536 | /* 0xE9 */ , 0x00
|
---|
537 | /* 0xEA */ , 0x00
|
---|
538 | /* 0xEB */ , 0x00
|
---|
539 | /* 0xEC */ , 0x00
|
---|
540 | /* 0xED */ , 0x00
|
---|
541 | /* 0xEE */ , 0x00
|
---|
542 | /* 0xEF */ , 0x00
|
---|
543 | /* 0xF0 */ , 0x00
|
---|
544 | /* 0xF1 */ , 0x00
|
---|
545 | /* 0xF2 */ , 0x00
|
---|
546 | /* 0xF3 */ , 0x00
|
---|
547 | /* 0xF4 */ , 0x00
|
---|
548 | /* 0xF5 */ , 0x00
|
---|
549 | /* 0xF6 VK_ATTN */ , 0x00
|
---|
550 | /* 0xF7 VK_CRSEL */ , 0x00
|
---|
551 | /* 0xF8 VK_EXSEL */ , 0x00
|
---|
552 | /* 0xF9 VK_EREOF */ , PMSCAN_ERASEEOF
|
---|
553 | /* 0xFA VK_PLAY */ , 0x00
|
---|
554 | /* 0xFB VK_ZOOM */ , 0x00
|
---|
555 | /* 0xFC VK_NONAME */ , 0x00
|
---|
556 | /* 0xFD VK_PA1 */ , PMSCAN_PA1
|
---|
557 | /* 0xFE VK_OEM_CLEAR */ , 0x00
|
---|
558 | /* 0xFF */ , 0x00
|
---|
559 | };
|
---|
560 |
|
---|
561 | //******************************************************************************
|
---|
562 | //******************************************************************************
|
---|
563 | void WIN32API KeyTranslatePMToWinBuf(BYTE *pmkey, BYTE *winkey, int nrkeys)
|
---|
564 | {
|
---|
565 | for(int i=1;i<nrkeys;i++) {
|
---|
566 | if(abWinVKeyToPMScan[i]) {
|
---|
567 | winkey[i] = pmkey[OSLibWinTranslateChar(abWinVKeyToPMScan[i], TC_SCANCODETOVIRTUALKEY, 0)];
|
---|
568 | }
|
---|
569 | }
|
---|
570 | winkey[VK_SHIFT] = winkey[VK_LSHIFT] | winkey[VK_RSHIFT];
|
---|
571 | winkey[VK_CONTROL] = winkey[VK_LCONTROL] | winkey[VK_RCONTROL];
|
---|
572 | winkey[VK_MENU] = winkey[VK_LMENU] | winkey[VK_RMENU];
|
---|
573 | }
|
---|
574 | //******************************************************************************
|
---|
575 | //******************************************************************************
|
---|
576 | int WIN32API GetKeyboardType( int nTypeFlag)
|
---|
577 | {
|
---|
578 | dprintf(("USER32: GetKeyboardType %x", nTypeFlag));
|
---|
579 | return O32_GetKeyboardType(nTypeFlag);
|
---|
580 | }
|
---|
581 | //******************************************************************************
|
---|
582 | //******************************************************************************
|
---|
583 | BOOL WIN32API GetKeyboardState(PBYTE lpKeyState)
|
---|
584 | {
|
---|
585 | BYTE PMKeyState[256];
|
---|
586 | BOOL rc;
|
---|
587 |
|
---|
588 | dprintf(("USER32: GetKeyboardState %x", lpKeyState));
|
---|
589 | memset(PMKeyState, 0, sizeof(PMKeyState));
|
---|
590 | memset(lpKeyState, 0, 256);
|
---|
591 | rc = OSLibWinGetKeyboardStateTable((PBYTE)&PMKeyState[0] );
|
---|
592 | //// rc = O32_GetKeyboardState(lpKeyState);
|
---|
593 | if(rc == TRUE)
|
---|
594 | {
|
---|
595 | KeyTranslatePMToWinBuf((BYTE *)&PMKeyState[0], lpKeyState, 256);
|
---|
596 | #ifdef DEBUG
|
---|
597 | for(int i=0;i<256;i++) {
|
---|
598 | if(PMKeyState[i] & 0x80) {
|
---|
599 | dprintf2(("PM key 0x%0x = %x", i, PMKeyState[i]));
|
---|
600 | }
|
---|
601 | }
|
---|
602 | for(i=0;i<256;i++) {
|
---|
603 | if(lpKeyState[i]) {
|
---|
604 | dprintf2(("Win key 0x%0x = %x", i, lpKeyState[i]));
|
---|
605 | }
|
---|
606 | }
|
---|
607 | #endif
|
---|
608 | return TRUE;
|
---|
609 | }
|
---|
610 | return FALSE;
|
---|
611 | }
|
---|
612 | //******************************************************************************
|
---|
613 | //******************************************************************************
|
---|
614 | BOOL WIN32API SetKeyboardState(PBYTE lpKeyState)
|
---|
615 | {
|
---|
616 | dprintf(("USER32: SetKeyboardState %x not implemented", lpKeyState));
|
---|
617 | return(TRUE);
|
---|
618 | }
|
---|
619 | /***********************************************************************
|
---|
620 | * GetKeyboardLayout (USER32.250)
|
---|
621 | *
|
---|
622 | * FIXME: - device handle for keyboard layout defaulted to
|
---|
623 | * the language id. This is the way Windows default works.
|
---|
624 | * - the thread identifier (dwLayout) is also ignored.
|
---|
625 | */
|
---|
626 | // * Remark : Based on Wine version (991031)
|
---|
627 | HKL WIN32API GetKeyboardLayout(DWORD dwLayout)
|
---|
628 | {
|
---|
629 | HKL layout;
|
---|
630 | layout = GetSystemDefaultLCID(); /* FIXME */
|
---|
631 | layout |= (layout<<16); /* FIXME */
|
---|
632 | dprintf(("GetKeyboardLayout returning %08x\n",layout));
|
---|
633 | return layout;
|
---|
634 | }
|
---|
635 | /*****************************************************************************
|
---|
636 | * Name : BOOL WIN32API GetKeyboardLayoutNameA
|
---|
637 | * Purpose : The GetKeyboardLayoutName function retrieves the name of the
|
---|
638 | * active keyboard layout.
|
---|
639 | * Parameters: LPTSTR pwszKLID address of buffer for layout name
|
---|
640 | * Variables :
|
---|
641 | * Result : If the function succeeds, the return value is TRUE.
|
---|
642 | * If the function fails, the return value is FALSE. To get extended
|
---|
643 | * error information, call GetLastError.
|
---|
644 | * Remark : Based on Wine version (991031)
|
---|
645 | * Status : UNTESTED STUB
|
---|
646 | *
|
---|
647 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
648 | *****************************************************************************/
|
---|
649 | INT WIN32API GetKeyboardLayoutNameA(LPTSTR pwszKLID)
|
---|
650 | {
|
---|
651 | dprintf(("USER32:GetKeyboardLayoutNameA"));
|
---|
652 |
|
---|
653 | sprintf(pwszKLID, "%08x",GetKeyboardLayout(0));
|
---|
654 | return 1;
|
---|
655 | }
|
---|
656 | /*****************************************************************************
|
---|
657 | * Name : BOOL WIN32API GetKeyboardLayoutNameW
|
---|
658 | * Purpose : The GetKeyboardLayoutName function retrieves the name of the
|
---|
659 | * active keyboard layout.
|
---|
660 | * Parameters: LPTSTR pwszKLID address of buffer for layout name
|
---|
661 | * Variables :
|
---|
662 | * Result : If the function succeeds, the return value is TRUE.
|
---|
663 | * If the function fails, the return value is FALSE. To get extended
|
---|
664 | * error information, call GetLastError.
|
---|
665 | * Remark : Based on Wine version (991031)
|
---|
666 | * Status : UNTESTED STUB
|
---|
667 | *
|
---|
668 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
669 | *****************************************************************************/
|
---|
670 | INT WIN32API GetKeyboardLayoutNameW(LPWSTR pwszKLID)
|
---|
671 | {
|
---|
672 | LPSTR buf = (LPSTR)HEAP_xalloc( GetProcessHeap(), 0, strlen("00000409")+1);
|
---|
673 |
|
---|
674 | dprintf(("USER32:GetKeyboardLayoutNameA"));
|
---|
675 | int res = GetKeyboardLayoutNameA(buf);
|
---|
676 | lstrcpyAtoW(pwszKLID,buf);
|
---|
677 | HeapFree( GetProcessHeap(), 0, buf );
|
---|
678 | return res;
|
---|
679 | }
|
---|
680 | /***********************************************************************
|
---|
681 | * GetKeyboardLayoutList (USER32.251)
|
---|
682 | *
|
---|
683 | * FIXME: Supports only the system default language and layout and
|
---|
684 | * returns only 1 value.
|
---|
685 | *
|
---|
686 | * Return number of values available if either input parm is
|
---|
687 | * 0, per MS documentation.
|
---|
688 | *
|
---|
689 | * Remark : Based on Wine version (991031)
|
---|
690 | */
|
---|
691 | INT WINAPI GetKeyboardLayoutList(INT nBuff,HKL *layouts)
|
---|
692 | {
|
---|
693 | dprintf(("GetKeyboardLayoutList(%d,%p)\n",nBuff,layouts));
|
---|
694 | if (!nBuff || !layouts)
|
---|
695 | return 1;
|
---|
696 | if (layouts)
|
---|
697 | layouts[0] = GetKeyboardLayout(0);
|
---|
698 | return 1;
|
---|
699 | }
|
---|
700 | /*****************************************************************************
|
---|
701 | * Name : int WIN32API ToAscii
|
---|
702 | * Purpose : The ToAscii function translates the specified virtual-key code
|
---|
703 | * and keyboard state to the corresponding Windows character or characters.
|
---|
704 | * Parameters: UINT uVirtKey virtual-key code
|
---|
705 | * UINT uScanCode scan code
|
---|
706 | * PBYTE lpbKeyState address of key-state array
|
---|
707 | * LPWORD lpwTransKey buffer for translated key
|
---|
708 | * UINT fuState active-menu flag
|
---|
709 | * Variables :
|
---|
710 | * Result : 0 The specified virtual key has no translation for the current
|
---|
711 | * state of the keyboard.
|
---|
712 | * 1 One Windows character was copied to the buffer.
|
---|
713 | * 2 Two characters were copied to the buffer. This usually happens
|
---|
714 | * when a dead-key character (accent or diacritic) stored in the
|
---|
715 | * keyboard layout cannot be composed with the specified virtual
|
---|
716 | * key to form a single character.
|
---|
717 | * Remark :
|
---|
718 | * Status : UNTESTED STUB
|
---|
719 | *
|
---|
720 | * Author : SvL
|
---|
721 | *****************************************************************************/
|
---|
722 | int WIN32API ToAscii(UINT uVirtKey,
|
---|
723 | UINT uScanCode,
|
---|
724 | PBYTE lpbKeyState,
|
---|
725 | LPWORD lpwTransKey,
|
---|
726 | UINT fuState)
|
---|
727 | {
|
---|
728 | dprintf(("USER32:ToAscii (%x,%x,%08xh,%08xh,%x) partially implemented",
|
---|
729 | uVirtKey, uScanCode, lpbKeyState, lpwTransKey, fuState));
|
---|
730 |
|
---|
731 | INT ret;
|
---|
732 |
|
---|
733 | if (uScanCode == 0) {
|
---|
734 | /* This happens when doing Alt+letter : a fake 'down arrow' key press
|
---|
735 | event is generated by windows. Just ignore it. */
|
---|
736 | dprintf2(("scanCode=0, doing nothing"));
|
---|
737 | return 0;
|
---|
738 | }
|
---|
739 | if (uScanCode & 0x8000)
|
---|
740 | {
|
---|
741 | dprintf2(("Key UP, doing nothing"));
|
---|
742 | return 0;
|
---|
743 | }
|
---|
744 |
|
---|
745 | /* We have another special case for delete key (XK_Delete) on an
|
---|
746 | extended keyboard. X returns a char for it, but Windows doesn't */
|
---|
747 | if (uVirtKey == VK_DELETE)
|
---|
748 | {
|
---|
749 | *(char*)lpwTransKey = 0;
|
---|
750 | ret = 0;
|
---|
751 | }
|
---|
752 | else
|
---|
753 | if (uVirtKey == VK_ESCAPE) {
|
---|
754 | //NT returns VK_ESCAPE here
|
---|
755 | *(char*)lpwTransKey = VK_ESCAPE;
|
---|
756 | ret = 1;
|
---|
757 | }
|
---|
758 | else {
|
---|
759 | ULONG shiftstate = 0;
|
---|
760 |
|
---|
761 | //TODO: multiple characters returned (DBCS??)
|
---|
762 |
|
---|
763 | if(lpbKeyState[VK_LSHIFT] & 0x80) shiftstate |= TCF_LSHIFT;
|
---|
764 | if(lpbKeyState[VK_RSHIFT] & 0x80) shiftstate |= TCF_RSHIFT;
|
---|
765 | if(lpbKeyState[VK_SHIFT] & 0x80) shiftstate |= TCF_SHIFT;
|
---|
766 | if(lpbKeyState[VK_LCONTROL] & 0x80) shiftstate |= TCF_LCONTROL;
|
---|
767 | if(lpbKeyState[VK_RCONTROL] & 0x80) shiftstate |= TCF_RCONTROL;
|
---|
768 | if(lpbKeyState[VK_CONTROL] & 0x80) shiftstate |= TCF_CONTROL;
|
---|
769 | if(lpbKeyState[VK_LMENU] & 0x80) shiftstate |= TCF_ALT;
|
---|
770 | if(lpbKeyState[VK_RMENU] & 0x80) shiftstate |= TCF_ALTGR;
|
---|
771 | if(lpbKeyState[VK_MENU] & 0x80) shiftstate |= TCF_ALT;
|
---|
772 | if(lpbKeyState[VK_CAPITAL] & 1) shiftstate |= TCF_CAPSLOCK;
|
---|
773 | if(lpbKeyState[VK_NUMLOCK] & 1) shiftstate |= TCF_NUMLOCK;
|
---|
774 |
|
---|
775 | //NT only modifies the bytes it returns
|
---|
776 | *(char *)lpwTransKey = OSLibWinTranslateChar(uScanCode, TC_SCANCODETOCHAR, shiftstate);
|
---|
777 |
|
---|
778 | if(shiftstate & TCF_CONTROL) {
|
---|
779 | if(uVirtKey >= VK_A && uVirtKey <= VK_Z) {
|
---|
780 | //NT returns key-0x60 (or so it seems) for ctrl-(shift-)-a..z
|
---|
781 | if(shiftstate & (TCF_SHIFT|TCF_CAPSLOCK)) {
|
---|
782 | *(char *)lpwTransKey -= 0x40;
|
---|
783 | }
|
---|
784 | else *(char *)lpwTransKey -= 0x60;
|
---|
785 | }
|
---|
786 | else
|
---|
787 | if(uVirtKey == VK_SPACE) {
|
---|
788 | if(shiftstate & TCF_SHIFT) {
|
---|
789 | //NT returns 0 for ctrl-shift-space
|
---|
790 | *lpwTransKey = 0;
|
---|
791 | }
|
---|
792 | }
|
---|
793 | else {
|
---|
794 | //NT returns 0 for ctrl-0, ctrl-.
|
---|
795 | *lpwTransKey = 0;
|
---|
796 | }
|
---|
797 | }
|
---|
798 |
|
---|
799 | if(*(char *)lpwTransKey == 0) {
|
---|
800 | ret = 0;
|
---|
801 | }
|
---|
802 | else ret = 1;
|
---|
803 | }
|
---|
804 | dprintf2(("USER32:ToAscii returned %x, len %d", *lpwTransKey, ret));
|
---|
805 | return ret;
|
---|
806 | }
|
---|
807 | /*****************************************************************************
|
---|
808 | * Name : int WIN32API ToAsciiEx
|
---|
809 | * Purpose : The ToAscii function translates the specified virtual-key code
|
---|
810 | * and keyboard state to the corresponding Windows character or characters.
|
---|
811 | * Parameters: UINT uVirtKey virtual-key code
|
---|
812 | * UINT uScanCode scan code
|
---|
813 | * PBYTE lpbKeyState address of key-state array
|
---|
814 | * LPWORD lpwTransKey buffer for translated key
|
---|
815 | * UINT fuState active-menu flag
|
---|
816 | * HLK hlk keyboard layout handle
|
---|
817 | * Variables :
|
---|
818 | * Result : 0 The specified virtual key has no translation for the current
|
---|
819 | * state of the keyboard.
|
---|
820 | * 1 One Windows character was copied to the buffer.
|
---|
821 | * 2 Two characters were copied to the buffer. This usually happens
|
---|
822 | * when a dead-key character (accent or diacritic) stored in the
|
---|
823 | * keyboard layout cannot be composed with the specified virtual
|
---|
824 | * key to form a single character.
|
---|
825 | * Remark :
|
---|
826 | * Status : UNTESTED STUB
|
---|
827 | *
|
---|
828 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
829 | *****************************************************************************/
|
---|
830 | int WIN32API ToAsciiEx(UINT uVirtKey,
|
---|
831 | UINT uScanCode,
|
---|
832 | PBYTE lpbKeyState,
|
---|
833 | LPWORD lpwTransKey,
|
---|
834 | UINT fuState,
|
---|
835 | HKL hkl)
|
---|
836 | {
|
---|
837 | dprintf(("USER32:ToAsciiEx (%u,%u,%08xh,%08xh,%u,%08x) partially implemented",
|
---|
838 | uVirtKey,
|
---|
839 | uScanCode,
|
---|
840 | lpbKeyState,
|
---|
841 | lpwTransKey,
|
---|
842 | fuState,
|
---|
843 | hkl));
|
---|
844 |
|
---|
845 | return ToAscii(uVirtKey, uScanCode, lpbKeyState, lpwTransKey, fuState);
|
---|
846 | }
|
---|
847 | /*****************************************************************************
|
---|
848 | * Name : int WIN32API ToUnicode
|
---|
849 | * Purpose : The ToUnicode function translates the specified virtual-key code
|
---|
850 | * and keyboard state to the corresponding Unicode character or characters.
|
---|
851 | * Parameters: UINT wVirtKey virtual-key code
|
---|
852 | * UINT wScanCode scan code
|
---|
853 | * PBYTE lpKeyState address of key-state array
|
---|
854 | * LPWSTR pwszBuff buffer for translated key
|
---|
855 | * int cchBuff size of translated key buffer
|
---|
856 | * UINT wFlags set of function-conditioning flags
|
---|
857 | * Variables :
|
---|
858 | * Result : - 1 The specified virtual key is a dead-key character (accent or
|
---|
859 | * diacritic). This value is returned regardless of the keyboard
|
---|
860 | * layout, even if several characters have been typed and are
|
---|
861 | * stored in the keyboard state. If possible, even with Unicode
|
---|
862 | * keyboard layouts, the function has written a spacing version of
|
---|
863 | * the dead-key character to the buffer specified by pwszBuffer.
|
---|
864 | * For example, the function writes the character SPACING ACUTE
|
---|
865 | * (0x00B4), rather than the character NON_SPACING ACUTE (0x0301).
|
---|
866 | * 0 The specified virtual key has no translation for the current
|
---|
867 | * state of the keyboard. Nothing was written to the buffer
|
---|
868 | * specified by pwszBuffer.
|
---|
869 | * 1 One character was written to the buffer specified by pwszBuffer.
|
---|
870 | * 2 or more Two or more characters were written to the buffer specified by
|
---|
871 | * pwszBuff. The most common cause for this is that a dead-key
|
---|
872 | * character (accent or diacritic) stored in the keyboard layout
|
---|
873 | * could not be combined with the specified virtual key to form a
|
---|
874 | * single character.
|
---|
875 | * Remark :
|
---|
876 | * Status : UNTESTED STUB
|
---|
877 | *
|
---|
878 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
879 | *****************************************************************************/
|
---|
880 | int WIN32API ToUnicode(UINT uVirtKey,
|
---|
881 | UINT uScanCode,
|
---|
882 | PBYTE lpKeyState,
|
---|
883 | LPWSTR pwszBuff,
|
---|
884 | int cchBuff,
|
---|
885 | UINT wFlags)
|
---|
886 | {
|
---|
887 | dprintf(("USER32:ToUnicode (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
|
---|
888 | uVirtKey,
|
---|
889 | uScanCode,
|
---|
890 | lpKeyState,
|
---|
891 | pwszBuff,
|
---|
892 | cchBuff,
|
---|
893 | wFlags));
|
---|
894 |
|
---|
895 | return (0);
|
---|
896 | }
|
---|
897 | /*****************************************************************************
|
---|
898 | * Name : UINT WIN32API GetKBCodePage
|
---|
899 | * Purpose : The GetKBCodePage function is provided for compatibility with
|
---|
900 | * earlier versions of Windows. In the Win32 application programming
|
---|
901 | * interface (API) it just calls the GetOEMCP function.
|
---|
902 | * Parameters:
|
---|
903 | * Variables :
|
---|
904 | * Result : If the function succeeds, the return value is an OEM code-page
|
---|
905 | * identifier, or it is the default identifier if the registry
|
---|
906 | * value is not readable. For a list of OEM code-page identifiers,
|
---|
907 | * see GetOEMCP.
|
---|
908 | * Remark :
|
---|
909 | * Status : COMPLETELY IMPLEMENTED UNTESTED
|
---|
910 | *
|
---|
911 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
912 | *****************************************************************************/
|
---|
913 |
|
---|
914 | UINT WIN32API GetKBCodePage(VOID)
|
---|
915 | {
|
---|
916 | return (GetOEMCP());
|
---|
917 | }
|
---|
918 | //******************************************************************************
|
---|
919 | //******************************************************************************
|
---|
920 | int WIN32API GetKeyNameTextA( LPARAM lParam, LPSTR lpString, int nSize)
|
---|
921 | {
|
---|
922 | dprintf(("USER32: GetKeyNameTextA\n"));
|
---|
923 | return O32_GetKeyNameText(lParam,lpString,nSize);
|
---|
924 | }
|
---|
925 | //******************************************************************************
|
---|
926 | //******************************************************************************
|
---|
927 | int WIN32API GetKeyNameTextW( LPARAM lParam, LPWSTR lpString, int nSize)
|
---|
928 | {
|
---|
929 | dprintf(("USER32: GetKeyNameTextW DOES NOT WORK\n"));
|
---|
930 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
931 | return 0;
|
---|
932 | // return O32_GetKeyNameText(arg1, arg2, arg3);
|
---|
933 | }
|
---|
934 | //******************************************************************************
|
---|
935 | //******************************************************************************
|
---|
936 | SHORT WIN32API GetKeyState( int nVirtKey)
|
---|
937 | {
|
---|
938 | dprintf2(("USER32: GetKeyState %x", nVirtKey));
|
---|
939 | return O32_GetKeyState(nVirtKey);
|
---|
940 | }
|
---|
941 | //******************************************************************************
|
---|
942 | //******************************************************************************
|
---|
943 | WORD WIN32API GetAsyncKeyState(INT nVirtKey)
|
---|
944 | {
|
---|
945 | dprintf2(("USER32: GetAsyncKeyState %x", nVirtKey));
|
---|
946 | if(fVersionWarp3) {//Not present in Warp 3's PMWINX
|
---|
947 | return O32_GetKeyState(nVirtKey);
|
---|
948 | }
|
---|
949 | else return O32_GetAsyncKeyState(nVirtKey);
|
---|
950 | }
|
---|
951 | //******************************************************************************
|
---|
952 | //******************************************************************************
|
---|
953 | UINT WIN32API MapVirtualKeyA( UINT uCode, UINT uMapType)
|
---|
954 | {
|
---|
955 | dprintf(("USER32: MapVirtualKeyA %x %x", uCode, uMapType));
|
---|
956 | /* A quick fix for Commandos, very incomplete */
|
---|
957 | switch (uMapType) {
|
---|
958 | case 2:
|
---|
959 | if (uCode >= VK_A && uCode <= VK_Z) {
|
---|
960 | return 'A' + uCode - VK_A;
|
---|
961 | }
|
---|
962 | break;
|
---|
963 | }
|
---|
964 | return O32_MapVirtualKey(uCode,uMapType);
|
---|
965 | }
|
---|
966 | //******************************************************************************
|
---|
967 | //******************************************************************************
|
---|
968 | UINT WIN32API MapVirtualKeyW( UINT uCode, UINT uMapType)
|
---|
969 | {
|
---|
970 | dprintf(("USER32: MapVirtualKeyW\n"));
|
---|
971 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
972 | return O32_MapVirtualKey(uCode,uMapType);
|
---|
973 | }
|
---|
974 | /*****************************************************************************
|
---|
975 | * Name : UINT WIN32API MapVirtualKeyExA
|
---|
976 | * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
|
---|
977 | * code into a scan code or character value, or translates a scan
|
---|
978 | * code into a virtual-key code. The function translates the codes
|
---|
979 | * using the input language and physical keyboard layout identified
|
---|
980 | * by the given keyboard layout handle.
|
---|
981 | * Parameters:
|
---|
982 | * Variables :
|
---|
983 | * Result : The return value is either a scan code, a virtual-key code, or
|
---|
984 | * a character value, depending on the value of uCode and uMapType.
|
---|
985 | * If there is no translation, the return value is zero.
|
---|
986 | * Remark :
|
---|
987 | * Status : UNTESTED STUB
|
---|
988 | *
|
---|
989 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
990 | *****************************************************************************/
|
---|
991 | UINT WIN32API MapVirtualKeyExA(UINT uCode, UINT uMapType, HKL dwhkl)
|
---|
992 | {
|
---|
993 | dprintf(("USER32:MapVirtualKeyExA (%u,%u,%08x) partially implemented",
|
---|
994 | uCode,
|
---|
995 | uMapType,
|
---|
996 | dwhkl));
|
---|
997 |
|
---|
998 | return MapVirtualKeyA(uCode, uMapType);
|
---|
999 | }
|
---|
1000 | /*****************************************************************************
|
---|
1001 | * Name : UINT WIN32API MapVirtualKeyExW
|
---|
1002 | * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
|
---|
1003 | * code into a scan code or character value, or translates a scan
|
---|
1004 | * code into a virtual-key code. The function translates the codes
|
---|
1005 | * using the input language and physical keyboard layout identified
|
---|
1006 | * by the given keyboard layout handle.
|
---|
1007 | * Parameters:
|
---|
1008 | * Variables :
|
---|
1009 | * Result : The return value is either a scan code, a virtual-key code, or
|
---|
1010 | * a character value, depending on the value of uCode and uMapType.
|
---|
1011 | * If there is no translation, the return value is zero.
|
---|
1012 | * Remark :
|
---|
1013 | * Status : UNTESTED STUB
|
---|
1014 | *
|
---|
1015 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1016 | *****************************************************************************/
|
---|
1017 | UINT WIN32API MapVirtualKeyExW(UINT uCode, UINT uMapType, HKL dwhkl)
|
---|
1018 | {
|
---|
1019 | dprintf(("USER32:MapVirtualKeyExW (%u,%u,%08x) partially implemented",
|
---|
1020 | uCode, uMapType, dwhkl));
|
---|
1021 |
|
---|
1022 | return MapVirtualKeyW(uCode, uMapType);
|
---|
1023 | }
|
---|
1024 | /*****************************************************************************
|
---|
1025 | * Name : DWORD WIN32API OemKeyScan
|
---|
1026 | * Purpose : The OemKeyScan function maps OEM ASCII codes 0 through 0x0FF
|
---|
1027 | * into the OEM scan codes and shift states. The function provides
|
---|
1028 | * information that allows a program to send OEM text to another
|
---|
1029 | * program by simulating keyboard input.
|
---|
1030 | * Parameters:
|
---|
1031 | * Variables :
|
---|
1032 | * Result :
|
---|
1033 | * Remark :
|
---|
1034 | * Status : UNTESTED STUB
|
---|
1035 | *
|
---|
1036 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1037 | *****************************************************************************/
|
---|
1038 | DWORD WIN32API OemKeyScan(WORD wOemChar)
|
---|
1039 | {
|
---|
1040 | dprintf(("USER32:OemKeyScan (%u) not implemented.\n",
|
---|
1041 | wOemChar));
|
---|
1042 |
|
---|
1043 | return (wOemChar);
|
---|
1044 | }
|
---|
1045 | //******************************************************************************
|
---|
1046 | //******************************************************************************
|
---|
1047 | BOOL WIN32API RegisterHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT uVirtKey)
|
---|
1048 | {
|
---|
1049 | dprintf(("USER32: RegisterHotKey %x %d %x %x not implemented", hwnd, idHotKey, fuModifiers, uVirtKey));
|
---|
1050 | hwnd = Win32ToOS2Handle(hwnd);
|
---|
1051 | return(TRUE);
|
---|
1052 | }
|
---|
1053 | //******************************************************************************
|
---|
1054 | //******************************************************************************
|
---|
1055 | BOOL WIN32API UnregisterHotKey(HWND hwnd, int idHotKey)
|
---|
1056 | {
|
---|
1057 | dprintf(("USER32: UnregisterHotKey %x %d not implemented", hwnd, idHotKey));
|
---|
1058 | hwnd = Win32ToOS2Handle(hwnd);
|
---|
1059 |
|
---|
1060 | return(TRUE);
|
---|
1061 | }
|
---|
1062 | //******************************************************************************
|
---|
1063 | //SvL: 24-6-'97 - Added
|
---|
1064 | //******************************************************************************
|
---|
1065 | WORD WIN32API VkKeyScanA( char ch)
|
---|
1066 | {
|
---|
1067 | dprintf(("USER32: VkKeyScanA %x", ch));
|
---|
1068 | return O32_VkKeyScan(ch);
|
---|
1069 | }
|
---|
1070 | //******************************************************************************
|
---|
1071 | //******************************************************************************
|
---|
1072 | WORD WIN32API VkKeyScanW( WCHAR wch)
|
---|
1073 | {
|
---|
1074 | dprintf(("USER32: VkKeyScanW %x", wch));
|
---|
1075 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
1076 | return O32_VkKeyScan((char)wch);
|
---|
1077 | }
|
---|
1078 | /*****************************************************************************
|
---|
1079 | * Name : SHORT WIN32API VkKeyScanExW
|
---|
1080 | * Purpose : The VkKeyScanEx function translates a character to the
|
---|
1081 | * corresponding virtual-key code and shift state. The function
|
---|
1082 | * translates the character using the input language and physical
|
---|
1083 | * keyboard layout identified by the given keyboard layout handle.
|
---|
1084 | * Parameters: UINT uChar character to translate
|
---|
1085 | * HKL hkl keyboard layout handle
|
---|
1086 | * Variables :
|
---|
1087 | * Result : see docs
|
---|
1088 | * Remark :
|
---|
1089 | * Status : UNTESTED STUB
|
---|
1090 | *
|
---|
1091 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1092 | *****************************************************************************/
|
---|
1093 | WORD WIN32API VkKeyScanExW(WCHAR uChar,
|
---|
1094 | HKL hkl)
|
---|
1095 | {
|
---|
1096 | dprintf(("USER32:VkKeyScanExW (%u,%08x) partially implemented",
|
---|
1097 | uChar,hkl));
|
---|
1098 |
|
---|
1099 | return VkKeyScanW(uChar);
|
---|
1100 | }
|
---|
1101 | /*****************************************************************************
|
---|
1102 | * Name : SHORT WIN32API VkKeyScanExA
|
---|
1103 | * Purpose : The VkKeyScanEx function translates a character to the
|
---|
1104 | * corresponding virtual-key code and shift state. The function
|
---|
1105 | * translates the character using the input language and physical
|
---|
1106 | * keyboard layout identified by the given keyboard layout handle.
|
---|
1107 | * Parameters: UINT uChar character to translate
|
---|
1108 | * HKL hkl keyboard layout handle
|
---|
1109 | * Variables :
|
---|
1110 | * Result : see docs
|
---|
1111 | * Remark :
|
---|
1112 | * Status : UNTESTED STUB
|
---|
1113 | *
|
---|
1114 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1115 | *****************************************************************************/
|
---|
1116 | WORD WIN32API VkKeyScanExA(CHAR uChar,
|
---|
1117 | HKL hkl)
|
---|
1118 | {
|
---|
1119 | dprintf(("USER32:VkKeyScanExA (%u,%08x) partially implemented",
|
---|
1120 | uChar, hkl));
|
---|
1121 |
|
---|
1122 | return VkKeyScanA(uChar);
|
---|
1123 | }
|
---|
1124 | /*****************************************************************************
|
---|
1125 | * Name : VOID WIN32API keybd_event
|
---|
1126 | * Purpose : The keybd_event function synthesizes a keystroke. The system
|
---|
1127 | * can use such a synthesized keystroke to generate a WM_KEYUP or
|
---|
1128 | * WM_KEYDOWN message. The keyboard driver's interrupt handler calls
|
---|
1129 | * the keybd_event function.
|
---|
1130 | * Parameters: BYTE bVk virtual-key code
|
---|
1131 |
|
---|
1132 | * BYTE bScan hardware scan code
|
---|
1133 | * DWORD dwFlags flags specifying various function options
|
---|
1134 | * DWORD dwExtraInfo additional data associated with keystroke
|
---|
1135 | * Variables :
|
---|
1136 | * Result :
|
---|
1137 | * Remark :
|
---|
1138 | * Status : UNTESTED STUB
|
---|
1139 | *
|
---|
1140 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1141 | *****************************************************************************/
|
---|
1142 | VOID WIN32API keybd_event (BYTE bVk,
|
---|
1143 | BYTE bScan,
|
---|
1144 | DWORD dwFlags,
|
---|
1145 | DWORD dwExtraInfo)
|
---|
1146 | {
|
---|
1147 | dprintf(("USER32:keybd_event (%u,%u,%08xh,%08x) not implemented.\n",
|
---|
1148 | bVk,
|
---|
1149 | bScan,
|
---|
1150 | dwFlags,
|
---|
1151 | dwExtraInfo));
|
---|
1152 | }
|
---|
1153 | /*****************************************************************************
|
---|
1154 | * Name : HLK WIN32API LoadKeyboardLayoutA
|
---|
1155 | * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
|
---|
1156 | * the system. Several keyboard layouts can be loaded at a time, but
|
---|
1157 | * only one per process is active at a time. Loading multiple keyboard
|
---|
1158 | * layouts makes it possible to rapidly switch between layouts.
|
---|
1159 | * Parameters:
|
---|
1160 | * Variables :
|
---|
1161 | * Result : If the function succeeds, the return value is the handle of the
|
---|
1162 | * keyboard layout.
|
---|
1163 | * If the function fails, the return value is NULL. To get extended
|
---|
1164 | * error information, call GetLastError.
|
---|
1165 | * Remark :
|
---|
1166 | * Status : UNTESTED STUB
|
---|
1167 | *
|
---|
1168 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1169 | *****************************************************************************/
|
---|
1170 | HKL WIN32API LoadKeyboardLayoutA(LPCTSTR pwszKLID,
|
---|
1171 | UINT Flags)
|
---|
1172 | {
|
---|
1173 | dprintf(("USER32:LeadKeyboardLayoutA (%s,%u) not implemented.\n",
|
---|
1174 | pwszKLID,
|
---|
1175 | Flags));
|
---|
1176 |
|
---|
1177 | return (NULL);
|
---|
1178 | }
|
---|
1179 | /*****************************************************************************
|
---|
1180 | * Name : HLK WIN32API LoadKeyboardLayoutW
|
---|
1181 | * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
|
---|
1182 | * the system. Several keyboard layouts can be loaded at a time, but
|
---|
1183 | * only one per process is active at a time. Loading multiple keyboard
|
---|
1184 | * layouts makes it possible to rapidly switch between layouts.
|
---|
1185 | * Parameters:
|
---|
1186 | * Variables :
|
---|
1187 | * Result : If the function succeeds, the return value is the handle of the
|
---|
1188 | * keyboard layout.
|
---|
1189 | * If the function fails, the return value is NULL. To get extended
|
---|
1190 | * error information, call GetLastError.
|
---|
1191 | * Remark :
|
---|
1192 | * Status : UNTESTED STUB
|
---|
1193 | *
|
---|
1194 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1195 | *****************************************************************************/
|
---|
1196 | HKL WIN32API LoadKeyboardLayoutW(LPCWSTR pwszKLID,
|
---|
1197 | UINT Flags)
|
---|
1198 | {
|
---|
1199 | dprintf(("USER32:LeadKeyboardLayoutW (%s,%u) not implemented.\n",
|
---|
1200 | pwszKLID,
|
---|
1201 | Flags));
|
---|
1202 |
|
---|
1203 | return (NULL);
|
---|
1204 | }
|
---|
1205 | //******************************************************************************
|
---|
1206 | //******************************************************************************
|
---|
1207 | BOOL WIN32API ActivateKeyboardLayout(HKL hkl, UINT fuFlags)
|
---|
1208 | {
|
---|
1209 | dprintf(("USER32: ActivateKeyboardLayout, not implemented\n"));
|
---|
1210 | return(TRUE);
|
---|
1211 | }
|
---|
1212 | /*****************************************************************************
|
---|
1213 | * Name : BOOL WIN32API UnloadKeyboardLayout
|
---|
1214 | * Purpose : The UnloadKeyboardLayout function removes a keyboard layout.
|
---|
1215 | * Parameters: HKL hkl handle of keyboard layout
|
---|
1216 | * Variables :
|
---|
1217 | * Result : If the function succeeds, the return value is the handle of the
|
---|
1218 | * keyboard layout; otherwise, it is NULL. To get extended error
|
---|
1219 | * information, use the GetLastError function.
|
---|
1220 | * Remark :
|
---|
1221 | * Status : UNTESTED STUB
|
---|
1222 | *
|
---|
1223 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
1224 | *****************************************************************************/
|
---|
1225 | BOOL WIN32API UnloadKeyboardLayout (HKL hkl)
|
---|
1226 | {
|
---|
1227 | dprintf(("USER32:UnloadKeyboardLayout (%08x) not implemented.\n",
|
---|
1228 | hkl));
|
---|
1229 |
|
---|
1230 | return (0);
|
---|
1231 | }
|
---|
1232 | //******************************************************************************
|
---|
1233 | //******************************************************************************
|
---|