63b727ca21f258a22049b7e5a6b044d144db2985
[reactos.git] / lib / user32 / windows / input.c
1 /*
2  *  ReactOS kernel
3  *  Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 /* $Id$
20  *
21  * PROJECT:         ReactOS user32.dll
22  * FILE:            lib/user32/windows/input.c
23  * PURPOSE:         Input
24  * PROGRAMMER:      Casper S. Hornstrup (chorns@users.sourceforge.net)
25  * UPDATE HISTORY:
26  *      09-05-2001  CSH  Created
27  */
28
29 /* INCLUDES ******************************************************************/
30
31 #include <windows.h>
32 #include <user32.h>
33 #include <debug.h>
34
35 /* FUNCTIONS *****************************************************************/
36
37
38 /*
39  * @implemented
40  */
41 WINBOOL
42 STDCALL
43 DragDetect(
44   HWND hWnd,
45   POINT pt)
46 {
47   return NtUserDragDetect(hWnd, pt.x, pt.y);
48 }
49
50
51 /*
52  * @unimplemented
53  */
54 HKL STDCALL
55 ActivateKeyboardLayout(HKL hkl,
56                        UINT Flags)
57 {
58   UNIMPLEMENTED;
59   return (HKL)0;
60 }
61
62
63 /*
64  * @unimplemented
65  */
66 WINBOOL STDCALL
67 BlockInput(WINBOOL fBlockIt)
68 {
69   UNIMPLEMENTED;
70   return FALSE;
71 }
72
73
74 /*
75  * @implemented
76  */
77 WINBOOL STDCALL
78 EnableWindow(HWND hWnd,
79              WINBOOL bEnable)
80 {
81     LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
82     Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
83     NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
84     
85     SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
86     
87     // Return nonzero if it was disabled, or zero if it wasn't:
88     return IsWindowEnabled(hWnd);
89 }
90
91
92 /*
93  * @unimplemented
94  */
95 SHORT STDCALL
96 GetAsyncKeyState(int vKey)
97 {
98   UNIMPLEMENTED;
99   return 0;
100 }
101
102
103 /*
104  * @implemented
105  */
106 UINT
107 STDCALL
108 GetDoubleClickTime(VOID)
109 {
110   return NtUserGetDoubleClickTime();
111 }
112
113
114 /*
115  * @unimplemented
116  */
117 HKL STDCALL
118 GetKeyboardLayout(DWORD idThread)
119 {
120   UNIMPLEMENTED;
121   return (HKL)0;
122 }
123
124
125 /*
126  * @unimplemented
127  */
128 UINT STDCALL
129 GetKBCodePage(VOID)
130 {
131   UNIMPLEMENTED;
132   return 0;
133 }
134
135
136 /*
137  * @unimplemented
138  */
139 int STDCALL
140 GetKeyNameTextA(LONG lParam,
141                 LPSTR lpString,
142                 int nSize)
143 {
144   UNIMPLEMENTED;
145   return 0;
146 }
147
148
149 /*
150  * @unimplemented
151  */
152 int STDCALL
153 GetKeyNameTextW(LONG lParam,
154                 LPWSTR lpString,
155                 int nSize)
156 {
157   UNIMPLEMENTED;
158   return 0;
159 }
160
161
162 /*
163  * @unimplemented
164  */
165 SHORT STDCALL
166 GetKeyState(int nVirtKey)
167 {
168  return (SHORT) NtUserGetKeyState((DWORD) nVirtKey);
169 }
170
171
172 /*
173  * @unimplemented
174  */
175 UINT STDCALL
176 GetKeyboardLayoutList(int nBuff,
177                       HKL FAR *lpList)
178 {
179   UNIMPLEMENTED;
180   return 0;
181 }
182
183
184 /*
185  * @unimplemented
186  */
187 WINBOOL STDCALL
188 GetKeyboardLayoutNameA(LPSTR pwszKLID)
189 {
190   UNIMPLEMENTED;
191   return FALSE;
192 }
193
194
195 /*
196  * @unimplemented
197  */
198 WINBOOL STDCALL
199 GetKeyboardLayoutNameW(LPWSTR pwszKLID)
200 {
201   UNIMPLEMENTED;
202   return FALSE;
203 }
204
205
206 /*
207  * @unimplemented
208  */
209 WINBOOL STDCALL
210 GetKeyboardState(PBYTE lpKeyState)
211 {
212   
213   return (WINBOOL) NtUserGetKeyboardState((LPBYTE) lpKeyState);
214 }
215
216
217 /*
218  * @unimplemented
219  */
220 int STDCALL
221 GetKeyboardType(int nTypeFlag)
222 {
223   UNIMPLEMENTED;
224   return 0;
225 }
226
227
228 /*
229  * @unimplemented
230  */
231 WINBOOL STDCALL
232 GetLastInputInfo(PLASTINPUTINFO plii)
233 {
234   UNIMPLEMENTED;
235   return FALSE;
236 }
237
238
239 /*
240  * @unimplemented
241  */
242 HKL STDCALL
243 LoadKeyboardLayoutA(LPCSTR pwszKLID,
244                     UINT Flags)
245 {
246   UNIMPLEMENTED;
247   return (HKL)0;
248 }
249
250
251 /*
252  * @unimplemented
253  */
254 HKL STDCALL
255 LoadKeyboardLayoutW(LPCWSTR pwszKLID,
256                     UINT Flags)
257 {
258   UNIMPLEMENTED;
259   return (HKL)0;
260 }
261
262
263 /*
264  * @unimplemented
265  */
266 UINT STDCALL
267 MapVirtualKeyA(UINT uCode,
268                UINT uMapType)
269 {
270   UNIMPLEMENTED;
271   return 0;
272 }
273
274
275 /*
276  * @unimplemented
277  */
278 UINT STDCALL
279 MapVirtualKeyExA(UINT uCode,
280                  UINT uMapType,
281                  HKL dwhkl)
282 {
283   UNIMPLEMENTED;
284   return 0;
285 }
286
287
288 /*
289  * @unimplemented
290  */
291 UINT STDCALL
292 MapVirtualKeyExW(UINT uCode,
293                  UINT uMapType,
294                  HKL dwhkl)
295 {
296   UNIMPLEMENTED;
297   return 0;
298 }
299
300
301 /*
302  * @unimplemented
303  */
304 UINT STDCALL
305 MapVirtualKeyW(UINT uCode,
306                UINT uMapType)
307 {
308   UNIMPLEMENTED;
309   return 0;
310 }
311
312
313 /*
314  * @unimplemented
315  */
316 DWORD STDCALL
317 OemKeyScan(WORD wOemChar)
318 {
319   UNIMPLEMENTED;
320   return 0;
321 }
322
323
324 /*
325  * @implemented
326  */
327 WINBOOL
328 STDCALL
329 SetDoubleClickTime(
330   UINT uInterval)
331 {
332   return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
333                                              uInterval,
334                                              NULL,
335                                              0);
336 }
337
338
339 /*
340  * @unimplemented
341  */
342 HWND STDCALL
343 SetFocus(HWND hWnd)
344 {
345   return NtUserSetFocus(hWnd);
346 }
347
348
349 /*
350  * @unimplemented
351  */
352 WINBOOL STDCALL
353 SetKeyboardState(LPBYTE lpKeyState)
354 {
355  return (WINBOOL) NtUserSetKeyboardState((LPBYTE)lpKeyState);
356 }
357
358
359 /*
360  * @implemented
361  */
362 WINBOOL
363 STDCALL
364 SwapMouseButton(
365   WINBOOL fSwap)
366 {
367   return (WINBOOL)NtUserCallOneParam((DWORD)fSwap, 
368                                      ONEPARAM_ROUTINE_SWAPMOUSEBUTTON);
369 }
370
371
372 /*
373  * @unimplemented
374  */
375 int STDCALL
376 ToAscii(UINT uVirtKey,
377         UINT uScanCode,
378         CONST PBYTE lpKeyState,
379         LPWORD lpChar,
380         UINT uFlags)
381 {
382   UNIMPLEMENTED;
383   return 0;
384 }
385
386
387 /*
388  * @unimplemented
389  */
390 int STDCALL
391 ToAsciiEx(UINT uVirtKey,
392           UINT uScanCode,
393           CONST PBYTE lpKeyState,
394           LPWORD lpChar,
395           UINT uFlags,
396           HKL dwhkl)
397 {
398   UNIMPLEMENTED;
399   return 0;
400 }
401
402
403 /*
404  * @unimplemented
405  */
406 int STDCALL
407 ToUnicode(UINT wVirtKey,
408           UINT wScanCode,
409           CONST PBYTE lpKeyState,
410           LPWSTR pwszBuff,
411           int cchBuff,
412           UINT wFlags)
413 {
414   UNIMPLEMENTED;
415   return 0;
416 }
417
418
419 /*
420  * @unimplemented
421  */
422 int STDCALL
423 ToUnicodeEx(UINT wVirtKey,
424             UINT wScanCode,
425             CONST PBYTE lpKeyState,
426             LPWSTR pwszBuff,
427             int cchBuff,
428             UINT wFlags,
429             HKL dwhkl)
430 {
431   UNIMPLEMENTED;
432   return 0;
433 }
434
435
436 /*
437  * @unimplemented
438  */
439 WINBOOL STDCALL
440 UnloadKeyboardLayout(HKL hkl)
441 {
442   UNIMPLEMENTED;
443   return FALSE;
444 }
445
446
447 /*
448  * @unimplemented
449  */
450 SHORT STDCALL
451 VkKeyScanA(CHAR ch)
452 {
453   UNIMPLEMENTED;
454   return 0;
455 }
456
457
458 /*
459  * @unimplemented
460  */
461 SHORT STDCALL
462 VkKeyScanExA(CHAR ch,
463              HKL dwhkl)
464 {
465   UNIMPLEMENTED;
466   return 0;
467 }
468
469
470 /*
471  * @unimplemented
472  */
473 SHORT STDCALL
474 VkKeyScanExW(WCHAR ch,
475              HKL dwhkl)
476 {
477   UNIMPLEMENTED;
478   return 0;
479 }
480
481
482 /*
483  * @unimplemented
484  */
485 SHORT STDCALL
486 VkKeyScanW(WCHAR ch)
487 {
488   UNIMPLEMENTED;
489   return 0;
490 }
491
492
493 /*
494  * @unimplemented
495  */
496 UINT
497 STDCALL
498 SendInput(
499   UINT nInputs,
500   LPINPUT pInputs,
501   int cbSize)
502 {
503   UNIMPLEMENTED;
504   return 0;
505 }