3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
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.
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.
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.
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/windows/input.c
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
26 * 09-05-2001 CSH Created
29 /* INCLUDES ******************************************************************/
35 /* FUNCTIONS *****************************************************************/
47 return NtUserDragDetect(hWnd, pt.x, pt.y);
55 ActivateKeyboardLayout(HKL hkl,
67 BlockInput(WINBOOL fBlockIt)
78 EnableWindow(HWND hWnd,
81 LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
82 Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
83 NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
85 SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
87 // Return nonzero if it was disabled, or zero if it wasn't:
88 return IsWindowEnabled(hWnd);
96 GetAsyncKeyState(int vKey)
108 GetDoubleClickTime(VOID)
110 return NtUserGetDoubleClickTime();
118 GetKeyboardLayout(DWORD idThread)
140 GetKeyNameTextA(LONG lParam,
153 GetKeyNameTextW(LONG lParam,
166 GetKeyState(int nVirtKey)
168 return (SHORT) NtUserGetKeyState((DWORD) nVirtKey);
176 GetKeyboardLayoutList(int nBuff,
188 GetKeyboardLayoutNameA(LPSTR pwszKLID)
199 GetKeyboardLayoutNameW(LPWSTR pwszKLID)
210 GetKeyboardState(PBYTE lpKeyState)
213 return (WINBOOL) NtUserGetKeyboardState((LPBYTE) lpKeyState);
221 GetKeyboardType(int nTypeFlag)
232 GetLastInputInfo(PLASTINPUTINFO plii)
243 LoadKeyboardLayoutA(LPCSTR pwszKLID,
255 LoadKeyboardLayoutW(LPCWSTR pwszKLID,
267 MapVirtualKeyA(UINT uCode,
279 MapVirtualKeyExA(UINT uCode,
292 MapVirtualKeyExW(UINT uCode,
305 MapVirtualKeyW(UINT uCode,
317 OemKeyScan(WORD wOemChar)
332 return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
345 return NtUserSetFocus(hWnd);
353 SetKeyboardState(LPBYTE lpKeyState)
355 return (WINBOOL) NtUserSetKeyboardState((LPBYTE)lpKeyState);
367 return (WINBOOL)NtUserCallOneParam((DWORD)fSwap,
368 ONEPARAM_ROUTINE_SWAPMOUSEBUTTON);
376 ToAscii(UINT uVirtKey,
378 CONST PBYTE lpKeyState,
391 ToAsciiEx(UINT uVirtKey,
393 CONST PBYTE lpKeyState,
407 ToUnicode(UINT wVirtKey,
409 CONST PBYTE lpKeyState,
423 ToUnicodeEx(UINT wVirtKey,
425 CONST PBYTE lpKeyState,
440 UnloadKeyboardLayout(HKL hkl)
462 VkKeyScanExA(CHAR ch,
474 VkKeyScanExW(WCHAR ch,