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.
19 /* $Id: input.c,v 1.13 2003/08/17 22:45:40 silverblade Exp $
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
)
107 GetKeyboardLayout(DWORD idThread
)
129 GetKeyNameTextA(LONG lParam
,
142 GetKeyNameTextW(LONG lParam
,
155 GetKeyState(int nVirtKey
)
157 return (SHORT
) NtUserGetKeyState((DWORD
) nVirtKey
);
165 GetKeyboardLayoutList(int nBuff
,
177 GetKeyboardLayoutNameA(LPSTR pwszKLID
)
188 GetKeyboardLayoutNameW(LPWSTR pwszKLID
)
199 GetKeyboardState(PBYTE lpKeyState
)
202 return (WINBOOL
) NtUserGetKeyboardState((LPBYTE
) lpKeyState
);
210 GetKeyboardType(int nTypeFlag
)
221 GetLastInputInfo(PLASTINPUTINFO plii
)
232 LoadKeyboardLayoutA(LPCSTR pwszKLID
,
244 LoadKeyboardLayoutW(LPCWSTR pwszKLID
,
256 MapVirtualKeyA(UINT uCode
,
268 MapVirtualKeyExA(UINT uCode
,
281 MapVirtualKeyExW(UINT uCode
,
294 MapVirtualKeyW(UINT uCode
,
306 OemKeyScan(WORD wOemChar
)
319 return NtUserSetFocus(hWnd
);
327 SetKeyboardState(LPBYTE lpKeyState
)
329 return (WINBOOL
) NtUserSetKeyboardState((LPBYTE
)lpKeyState
);
337 ToAscii(UINT uVirtKey
,
339 CONST PBYTE lpKeyState
,
352 ToAsciiEx(UINT uVirtKey
,
354 CONST PBYTE lpKeyState
,
368 ToUnicode(UINT wVirtKey
,
370 CONST PBYTE lpKeyState
,
384 ToUnicodeEx(UINT wVirtKey
,
386 CONST PBYTE lpKeyState
,
401 UnloadKeyboardLayout(HKL hkl
)
423 VkKeyScanExA(CHAR ch
,
435 VkKeyScanExW(WCHAR ch
,