ReactOS 0.4.16-dev-106-g10b08aa
input.c File Reference
#include <user32.h>
#include <strsafe.h>
Include dependency graph for input.c:

Go to the source code of this file.

Classes

struct  tagIMEHOTKEYENTRY
 

Macros

#define FE_JAPANESE   (1 << 0)
 
#define FE_CHINESE_TRADITIONAL   (1 << 1)
 
#define FE_CHINESE_SIMPLIFIED   (1 << 2)
 
#define FE_KOREAN   (1 << 3)
 
#define MOD_ALL_MODS   (MOD_ALT | MOD_CONTROL | MOD_SHIFT | MOD_WIN)
 
#define ENGLISH_US   MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
 

Typedefs

typedef struct tagIMEHOTKEYENTRY IMEHOTKEYENTRY
 
typedef struct tagIMEHOTKEYENTRYPIMEHOTKEYENTRY
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
VOID FASTCALL IntSetFeKeyboardFlags (LANGID LangID, PBYTE pbFlags)
 
DWORD FASTCALL CliReadRegistryValue (HANDLE hKey, LPCWSTR pszName)
 
BOOL APIENTRY CliImmSetHotKeyWorker (DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL hKL, DWORD dwAction)
 
VOID IntLoadPreloadKeyboardLayouts (VOID)
 
BOOL APIENTRY CliSaveImeHotKey (DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKL, BOOL bDelete)
 
BOOL WINAPI CliImmSetHotKey (DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKL)
 
BOOL FASTCALL CliSetSingleHotKey (LPCWSTR pszSubKey, HANDLE hKey)
 
BOOL FASTCALL CliGetImeHotKeysFromRegistry (VOID)
 
VOID APIENTRY CliGetPreloadKeyboardLayouts (PBYTE pbFlags)
 
VOID APIENTRY CliSetDefaultImeHotKeys (PIMEHOTKEYENTRY pEntries, UINT nCount, BOOL bCheck)
 
VOID APIENTRY CliImmInitializeHotKeys (DWORD dwAction, HKL hKL)
 
BOOL WINAPI DragDetect (HWND hWnd, POINT pt)
 
BOOL WINAPI EnableWindow (HWND hWnd, BOOL bEnable)
 
SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState (int vKey)
 
HKL WINAPI GetKeyboardLayout (DWORD idThread)
 
UINT WINAPI GetKBCodePage (VOID)
 
int WINAPI GetKeyNameTextA (LONG lParam, LPSTR lpString, int nSize)
 
int WINAPI GetKeyNameTextW (LONG lParam, LPWSTR lpString, int nSize)
 
SHORT WINAPI DECLSPEC_HOTPATCH GetKeyState (int nVirtKey)
 
BOOL WINAPI GetKeyboardLayoutNameA (LPSTR pwszKLID)
 
BOOL WINAPI GetKeyboardLayoutNameW (LPWSTR pwszKLID)
 
int WINAPI GetKeyboardType (int nTypeFlag)
 
BOOL WINAPI GetLastInputInfo (PLASTINPUTINFO plii)
 
HKL WINAPI LoadKeyboardLayoutA (LPCSTR pszKLID, UINT Flags)
 
static BOOL IsValidKLID (_In_ LPCWSTR pwszKLID)
 
VOID GetSystemLibraryPath (LPWSTR pszPath, INT cchPath, LPCWSTR pszFileName)
 
HKL APIENTRY IntLoadKeyboardLayout (_In_ HKL hklUnload, _In_z_ LPCWSTR pwszKLID, _In_ LANGID wLangID, _In_ UINT Flags, _In_ BOOL unknown5)
 
HKL WINAPI LoadKeyboardLayoutW (LPCWSTR pwszKLID, UINT Flags)
 
HKL WINAPI LoadKeyboardLayoutEx (HKL hklUnload, LPCWSTR pwszKLID, UINT Flags)
 
BOOL WINAPI UnloadKeyboardLayout (HKL hKL)
 
UINT WINAPI MapVirtualKeyA (UINT uCode, UINT uMapType)
 
UINT WINAPI MapVirtualKeyExA (UINT uCode, UINT uMapType, HKL dwhkl)
 
UINT WINAPI MapVirtualKeyExW (UINT uCode, UINT uMapType, HKL dwhkl)
 
UINT WINAPI MapVirtualKeyW (UINT uCode, UINT uMapType)
 
DWORD WINAPI OemKeyScan (WORD wOemChar)
 
BOOL WINAPI SetDoubleClickTime (UINT uInterval)
 
BOOL WINAPI SwapMouseButton (BOOL fSwap)
 
int WINAPI ToAscii (UINT uVirtKey, UINT uScanCode, CONST BYTE *lpKeyState, LPWORD lpChar, UINT uFlags)
 
int WINAPI ToAsciiEx (UINT uVirtKey, UINT uScanCode, CONST BYTE *lpKeyState, LPWORD lpChar, UINT uFlags, HKL dwhkl)
 
int WINAPI ToUnicode (UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags)
 
int WINAPI ToUnicodeEx (UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
 
SHORT WINAPI VkKeyScanA (CHAR ch)
 
SHORT WINAPI VkKeyScanExA (CHAR ch, HKL dwhkl)
 
SHORT WINAPI VkKeyScanExW (WCHAR ch, HKL dwhkl)
 
SHORT WINAPI VkKeyScanW (WCHAR ch)
 
VOID WINAPI keybd_event (BYTE bVk, BYTE bScan, DWORD dwFlags, ULONG_PTR dwExtraInfo)
 
VOID WINAPI mouse_event (DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData, ULONG_PTR dwExtraInfo)
 

Variables

IMEHOTKEYENTRY DefaultHotKeyTableJ []
 
IMEHOTKEYENTRY DefaultHotKeyTableT []
 
IMEHOTKEYENTRY DefaultHotKeyTableC []
 

Macro Definition Documentation

◆ ENGLISH_US

Definition at line 696 of file input.c.

◆ FE_CHINESE_SIMPLIFIED

#define FE_CHINESE_SIMPLIFIED   (1 << 2)

Definition at line 65 of file input.c.

◆ FE_CHINESE_TRADITIONAL

#define FE_CHINESE_TRADITIONAL   (1 << 1)

Definition at line 64 of file input.c.

◆ FE_JAPANESE

#define FE_JAPANESE   (1 << 0)

Definition at line 63 of file input.c.

◆ FE_KOREAN

#define FE_KOREAN   (1 << 3)

Definition at line 66 of file input.c.

◆ MOD_ALL_MODS

#define MOD_ALL_MODS   (MOD_ALT | MOD_CONTROL | MOD_SHIFT | MOD_WIN)

Typedef Documentation

◆ IMEHOTKEYENTRY

◆ PIMEHOTKEYENTRY

Function Documentation

◆ CliGetImeHotKeysFromRegistry()

BOOL FASTCALL CliGetImeHotKeysFromRegistry ( VOID  )

Definition at line 314 of file input.c.

315{
316 HKEY hKey;
317 LONG error;
318 BOOL ret = FALSE;
319 DWORD dwIndex, cchKeyName;
320 WCHAR szKeyName[16];
321
323 L"Control Panel\\Input Method\\Hot Keys",
324 0,
325 KEY_READ,
326 &hKey);
327 if (error != ERROR_SUCCESS)
328 return ret;
329
330 for (dwIndex = 0; dwIndex < 1000; ++dwIndex)
331 {
332 cchKeyName = _countof(szKeyName);
333 error = RegEnumKeyExW(hKey, dwIndex, szKeyName, &cchKeyName, NULL, NULL, NULL, NULL);
334 if (error != ERROR_SUCCESS)
335 break;
336
337 szKeyName[_countof(szKeyName) - 1] = 0; /* Avoid stack overrun */
338
339 if (CliSetSingleHotKey(szKeyName, hKey))
340 ret = TRUE;
341 }
342
344 return ret;
345}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define _countof(array)
Definition: sndvol32.h:70
int ret
BOOL FASTCALL CliSetSingleHotKey(LPCWSTR pszSubKey, HANDLE hKey)
Definition: input.c:289
#define HKEY_CURRENT_USER
Definition: winreg.h:11
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CliImmInitializeHotKeys().

◆ CliGetPreloadKeyboardLayouts()

VOID APIENTRY CliGetPreloadKeyboardLayouts ( PBYTE  pbFlags)

Definition at line 347 of file input.c.

348{
349 WCHAR szValueName[33], szValue[16];
350 UNICODE_STRING ustrValue;
351 DWORD dwKL, cbValue, dwType;
352 UINT iNumber;
353 HKEY hKey;
354 LONG error;
355
356 error = RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Preload", 0, KEY_READ, &hKey);
357 if (error != ERROR_SUCCESS)
358 return;
359
360 for (iNumber = 1; iNumber < 1000; ++iNumber)
361 {
362 _ultow(iNumber, szValueName, 10);
363
364 cbValue = sizeof(szValue);
365 error = RegQueryValueExW(hKey, szValueName, NULL, &dwType, (LPBYTE)szValue, &cbValue);
366 if (error != ERROR_SUCCESS)
367 break;
368
369 if (dwType != REG_SZ)
370 continue;
371
372 szValue[_countof(szValue) - 1] = 0; /* Avoid stack overrun */
373
374 RtlInitUnicodeString(&ustrValue, szValue);
375 RtlUnicodeStringToInteger(&ustrValue, 16, &dwKL);
376
377 IntSetFeKeyboardFlags(LOWORD(dwKL), pbFlags);
378 }
379
381}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define REG_SZ
Definition: layer.c:22
unsigned int UINT
Definition: ndis.h:50
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
#define LOWORD(l)
Definition: pedump.c:82
unsigned char * LPBYTE
Definition: typedefs.h:53
VOID FASTCALL IntSetFeKeyboardFlags(LANGID LangID, PBYTE pbFlags)
Definition: input.c:70

Referenced by CliImmInitializeHotKeys().

◆ CliImmInitializeHotKeys()

VOID APIENTRY CliImmInitializeHotKeys ( DWORD  dwAction,
HKL  hKL 
)

Definition at line 402 of file input.c.

403{
404 UINT nCount;
405 LPHKL pList;
406 UINT iIndex;
408 BYTE bFlags = 0;
409 BOOL bCheck;
410
412
414
415 if (dwAction == SETIMEHOTKEY_INITIALIZE)
416 {
419
421 }
422 else
423 {
425 if (!nCount)
426 return;
427
428 pList = RtlAllocateHeap(RtlGetProcessHeap(), 0, nCount * sizeof(HKL));
429 if (!pList)
430 return;
431
433
434 for (iIndex = 0; iIndex < nCount; ++iIndex)
435 {
436 LangID = LOWORD(pList[iIndex]);
438 }
439
440 RtlFreeHeap(RtlGetProcessHeap(), 0, pList);
441 }
442
443 if (bFlags & FE_JAPANESE)
445
446 if (bFlags & FE_CHINESE_TRADITIONAL)
448
449 if (bFlags & FE_CHINESE_SIMPLIFIED)
451}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1210
FxChildList * pList
HKL FAR * LPHKL
Definition: imm.h:24
UINT NTAPI NtUserGetKeyboardLayoutList(ULONG nItems, HKL *pHklBuff)
Definition: kbdlayout.c:1038
BOOL NTAPI NtUserSetImeHotKey(DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL hKL, DWORD dwAction)
Definition: ime.c:451
USHORT LANGID
Definition: mui.h:9
UINT_PTR HKL
Definition: msctf.idl:143
#define LANGIDFROMLCID(l)
Definition: nls.h:18
@ SETIMEHOTKEY_INITIALIZE
Definition: undocuser.h:409
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
#define FE_JAPANESE
Definition: input.c:63
VOID APIENTRY CliGetPreloadKeyboardLayouts(PBYTE pbFlags)
Definition: input.c:347
IMEHOTKEYENTRY DefaultHotKeyTableT[]
Definition: input.c:49
IMEHOTKEYENTRY DefaultHotKeyTableC[]
Definition: input.c:56
#define FE_CHINESE_SIMPLIFIED
Definition: input.c:65
#define FE_CHINESE_TRADITIONAL
Definition: input.c:64
BOOL FASTCALL CliGetImeHotKeysFromRegistry(VOID)
Definition: input.c:314
IMEHOTKEYENTRY DefaultHotKeyTableJ[]
Definition: input.c:43
VOID APIENTRY CliSetDefaultImeHotKeys(PIMEHOTKEYENTRY pEntries, UINT nCount, BOOL bCheck)
Definition: input.c:383
unsigned char BYTE
Definition: xxhash.c:193

Referenced by IntLoadKeyboardLayout(), UnloadKeyboardLayout(), and UpdatePerUserSystemParameters().

◆ CliImmSetHotKey()

BOOL WINAPI CliImmSetHotKey ( DWORD  dwID,
UINT  uModifiers,
UINT  uVirtualKey,
HKL  hKL 
)

Definition at line 265 of file input.c.

266{
267 BOOL ret;
268
269 if (uVirtualKey == 0) // Delete?
270 {
271 ret = CliSaveImeHotKey(dwID, uModifiers, uVirtualKey, hKL, TRUE);
272 if (ret)
273 CliImmSetHotKeyWorker(dwID, uModifiers, uVirtualKey, hKL, SETIMEHOTKEY_DELETE);
274 return ret;
275 }
276
277 // Add
278 ret = CliImmSetHotKeyWorker(dwID, uModifiers, uVirtualKey, hKL, SETIMEHOTKEY_ADD);
279 if (ret)
280 {
281 ret = CliSaveImeHotKey(dwID, uModifiers, uVirtualKey, hKL, FALSE);
282 if (!ret) // Failure?
283 CliImmSetHotKeyWorker(dwID, uModifiers, uVirtualKey, hKL, SETIMEHOTKEY_DELETE);
284 }
285
286 return ret;
287}
@ SETIMEHOTKEY_ADD
Definition: undocuser.h:408
@ SETIMEHOTKEY_DELETE
Definition: undocuser.h:407
BOOL APIENTRY CliImmSetHotKeyWorker(DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL hKL, DWORD dwAction)
Definition: input.c:111
BOOL APIENTRY CliSaveImeHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKL, BOOL bDelete)
Definition: input.c:210

◆ CliImmSetHotKeyWorker()

BOOL APIENTRY CliImmSetHotKeyWorker ( DWORD  dwHotKeyId,
UINT  uModifiers,
UINT  uVirtualKey,
HKL  hKL,
DWORD  dwAction 
)

Definition at line 111 of file input.c.

112{
113 if (dwAction == SETIMEHOTKEY_ADD)
114 {
115 if (IME_HOTKEY_DSWITCH_FIRST <= dwHotKeyId && dwHotKeyId <= IME_HOTKEY_DSWITCH_LAST)
116 {
117 if (!hKL)
118 goto Failure;
119 }
120 else
121 {
122 if (hKL)
123 goto Failure;
124
125 if (IME_KHOTKEY_SHAPE_TOGGLE <= dwHotKeyId &&
127 {
128 // The Korean cannot set the IME hotkeys
129 goto Failure;
130 }
131 }
132
133#define MOD_ALL_MODS (MOD_ALT | MOD_CONTROL | MOD_SHIFT | MOD_WIN)
134 if ((uModifiers & MOD_ALL_MODS) && !(uModifiers & (MOD_LEFT | MOD_RIGHT)))
135 goto Failure;
136#undef MOD_ALL_MODS
137 }
138
139 return NtUserSetImeHotKey(dwHotKeyId, uModifiers, uVirtualKey, hKL, dwAction);
140
141Failure:
143 return FALSE;
144}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define MOD_LEFT
Definition: imm.h:188
#define IME_THOTKEY_IME_NONIME_TOGGLE
Definition: imm.h:207
#define IME_KHOTKEY_SHAPE_TOGGLE
Definition: imm.h:203
#define IME_HOTKEY_DSWITCH_LAST
Definition: imm.h:213
#define IME_HOTKEY_DSWITCH_FIRST
Definition: imm.h:212
#define MOD_RIGHT
Definition: imm.h:189
#define MOD_ALL_MODS

Referenced by CliImmSetHotKey(), CliSetDefaultImeHotKeys(), and CliSetSingleHotKey().

◆ CliReadRegistryValue()

DWORD FASTCALL CliReadRegistryValue ( HANDLE  hKey,
LPCWSTR  pszName 
)

Definition at line 97 of file input.c.

98{
99 DWORD dwValue, cbValue;
100 LONG error;
101
102 cbValue = sizeof(dwValue);
103 error = RegQueryValueExW(hKey, pszName, NULL, NULL, (LPBYTE)&dwValue, &cbValue);
104 if (error != ERROR_SUCCESS || cbValue < sizeof(DWORD))
105 return 0;
106
107 return dwValue;
108}

Referenced by CliSetSingleHotKey().

◆ CliSaveImeHotKey()

BOOL APIENTRY CliSaveImeHotKey ( DWORD  dwID,
UINT  uModifiers,
UINT  uVirtualKey,
HKL  hKL,
BOOL  bDelete 
)

Definition at line 210 of file input.c.

211{
213 LONG error;
214 HKEY hKey;
215 BOOL ret = FALSE, bRevertOnFailure = FALSE;
216
218 L"Control Panel\\Input Method\\Hot Keys\\%08lX", dwID);
219
220 if (bDelete)
221 {
223 return (error == ERROR_SUCCESS);
224 }
225
227 if (error == ERROR_SUCCESS)
228 {
229 bRevertOnFailure = TRUE;
230
231 // Set "Virtual Key"
232 error = RegSetValueExW(hKey, L"Virtual Key", 0, REG_BINARY,
233 (LPBYTE)&uVirtualKey, sizeof(uVirtualKey));
234 if (error == ERROR_SUCCESS)
235 {
236 // Set "Key Modifiers"
237 error = RegSetValueExW(hKey, L"Key Modifiers", 0, REG_BINARY,
238 (LPBYTE)&uModifiers, sizeof(uModifiers));
239 if (error == ERROR_SUCCESS)
240 {
241 // Set "Target IME"
242 error = RegSetValueExW(hKey, L"Target IME", 0, REG_BINARY,
243 (LPBYTE)&hKL, sizeof(hKL));
244 if (error == ERROR_SUCCESS)
245 {
246 // Success!
247 ret = TRUE;
248 bRevertOnFailure = FALSE;
249 }
250 }
251 }
253 }
254
255 if (bRevertOnFailure)
256 CliSaveImeHotKey(dwID, uVirtualKey, uModifiers, hKL, TRUE);
257
258 return ret;
259}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
#define MAX_PATH
Definition: compat.h:34
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_WRITE
Definition: nt_native.h:1031
static const WCHAR szName[]
Definition: powrprof.c:45
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530

Referenced by CliImmSetHotKey(), and CliSaveImeHotKey().

◆ CliSetDefaultImeHotKeys()

VOID APIENTRY CliSetDefaultImeHotKeys ( PIMEHOTKEYENTRY  pEntries,
UINT  nCount,
BOOL  bCheck 
)

Definition at line 383 of file input.c.

384{
385 UINT uVirtualKey, uModifiers;
386 HKL hKL;
387
388 while (nCount-- > 0)
389 {
390 if (!bCheck || !NtUserGetImeHotKey(pEntries->dwHotKeyId, &uModifiers, &uVirtualKey, &hKL))
391 {
393 pEntries->uModifiers,
394 pEntries->uVirtualKey,
395 pEntries->hKL,
397 }
398 ++pEntries;
399 }
400}
BOOL NTAPI NtUserGetImeHotKey(DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, LPHKL lphKL)
Definition: ime.c:406
UINT uVirtualKey
Definition: input.c:37
DWORD dwHotKeyId
Definition: input.c:36
UINT uModifiers
Definition: input.c:38

Referenced by CliImmInitializeHotKeys().

◆ CliSetSingleHotKey()

BOOL FASTCALL CliSetSingleHotKey ( LPCWSTR  pszSubKey,
HANDLE  hKey 
)

Definition at line 289 of file input.c.

290{
291 LONG error;
292 HKEY hSubKey;
293 DWORD dwHotKeyId = 0;
294 UINT uModifiers = 0, uVirtualKey = 0;
295 HKL hKL = NULL;
296 UNICODE_STRING ustrName;
297
298 error = RegOpenKeyExW(hKey, pszSubKey, 0, KEY_READ, &hSubKey);
299 if (error != ERROR_SUCCESS)
300 return FALSE;
301
302 RtlInitUnicodeString(&ustrName, pszSubKey);
303 RtlUnicodeStringToInteger(&ustrName, 16, &dwHotKeyId);
304
305 uModifiers = CliReadRegistryValue(hSubKey, L"Key Modifiers");
306 hKL = (HKL)(ULONG_PTR)CliReadRegistryValue(hSubKey, L"Target IME");
307 uVirtualKey = CliReadRegistryValue(hSubKey, L"Virtual Key");
308
309 RegCloseKey(hSubKey);
310
311 return CliImmSetHotKeyWorker(dwHotKeyId, uModifiers, uVirtualKey, hKL, SETIMEHOTKEY_ADD);
312}
uint32_t ULONG_PTR
Definition: typedefs.h:65
DWORD FASTCALL CliReadRegistryValue(HANDLE hKey, LPCWSTR pszName)
Definition: input.c:97

Referenced by CliGetImeHotKeysFromRegistry().

◆ DragDetect()

BOOL WINAPI DragDetect ( HWND  hWnd,
POINT  pt 
)

Definition at line 458 of file input.c.

461{
462 return NtUserDragDetect(hWnd, pt);
463#if 0
464 MSG msg;
465 RECT rect;
466 POINT tmp;
469
470 rect.left = pt.x - dx;
471 rect.right = pt.x + dx;
472 rect.top = pt.y - dy;
473 rect.bottom = pt.y + dy;
474
476
477 for (;;)
478 {
479 while (
482 )
483 {
484 if (msg.message == WM_LBUTTONUP)
485 {
487 return FALSE;
488 }
489 if (msg.message == WM_MOUSEMOVE)
490 {
491 tmp.x = LOWORD(msg.lParam);
492 tmp.y = HIWORD(msg.lParam);
493 if (!PtInRect(&rect, tmp))
494 {
496 return TRUE;
497 }
498 }
499 if (msg.message == WM_KEYDOWN)
500 {
501 if (msg.wParam == VK_ESCAPE)
502 {
504 return TRUE;
505 }
506 }
507 }
508 WaitMessage();
509 }
510 return 0;
511#endif
512}
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define pt(x, y)
Definition: drawing.c:79
BOOL NTAPI NtUserDragDetect(HWND hWnd, POINT pt)
Definition: message.c:2209
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
& rect
Definition: startmenu.cpp:1413
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define WM_MOUSEFIRST
Definition: winuser.h:1777
#define SM_CXDRAG
Definition: winuser.h:1031
#define WM_MOUSELAST
Definition: winuser.h:1804
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define WM_KEYFIRST
Definition: winuser.h:1717
#define WM_MOUSEMOVE
Definition: winuser.h:1778
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1199
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_KEYDOWN
Definition: winuser.h:1718
#define SM_CYDRAG
Definition: winuser.h:1032
#define WM_KEYLAST
Definition: winuser.h:1731
#define VK_ESCAPE
Definition: winuser.h:2217
int WINAPI GetSystemMetrics(_In_ int)

◆ EnableWindow()

BOOL WINAPI EnableWindow ( HWND  hWnd,
BOOL  bEnable 
)

Definition at line 518 of file input.c.

519{
521}
EXTINLINE BOOL NtUserxEnableWindow(HWND hWnd, BOOL bEnable)
Definition: ntwrapper.h:681
_In_ BOOL bEnable
Definition: winddi.h:3426

◆ GetAsyncKeyState()

SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState ( int  vKey)

Definition at line 529 of file input.c.

530{
531 if (vKey < 0 || vKey > 256)
532 return 0;
533 return (SHORT)NtUserGetAsyncKeyState((DWORD)vKey);
534}
SHORT NTAPI NtUserGetAsyncKeyState(INT Key)
Definition: keyboard.c:634
short SHORT
Definition: pedump.c:59

◆ GetKBCodePage()

UINT WINAPI GetKBCodePage ( VOID  )

Definition at line 551 of file input.c.

552{
553 return GetOEMCP();
554}
UINT WINAPI GetOEMCP(void)
Definition: locale.c:2059

◆ GetKeyboardLayout()

HKL WINAPI GetKeyboardLayout ( DWORD  idThread)

Definition at line 541 of file input.c.

542{
543 return NtUserxGetKeyboardLayout(idThread);
544}
EXTINLINE HKL NtUserxGetKeyboardLayout(DWORD idThread)
Definition: ntwrapper.h:626

◆ GetKeyboardLayoutNameA()

BOOL WINAPI GetKeyboardLayoutNameA ( LPSTR  pwszKLID)

Definition at line 611 of file input.c.

612{
614
616 return FALSE;
617
618 if (!WideCharToMultiByte(CP_ACP, 0, buf, -1, pwszKLID, KL_NAMELENGTH, NULL, NULL))
619 return FALSE;
620
621 return TRUE;
622}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define KL_NAMELENGTH
Definition: winuser.h:122

◆ GetKeyboardLayoutNameW()

BOOL WINAPI GetKeyboardLayoutNameW ( LPWSTR  pwszKLID)

Definition at line 628 of file input.c.

629{
631
632 RtlInitEmptyUnicodeString(&Name,
633 pwszKLID,
634 KL_NAMELENGTH * sizeof(WCHAR));
635
637}
struct NameRec_ * Name
Definition: cdprocs.h:460
BOOL NTAPI NtUserGetKeyboardLayoutName(_Inout_ PUNICODE_STRING pustrName)
Definition: kbdlayout.c:1092

◆ GetKeyboardType()

int WINAPI GetKeyboardType ( int  nTypeFlag)

Definition at line 643 of file input.c.

644{
645 return NtUserxGetKeyboardType(nTypeFlag);
646}
EXTINLINE INT NtUserxGetKeyboardType(INT nTypeFlag)
Definition: ntwrapper.h:631

◆ GetKeyNameTextA()

int WINAPI GetKeyNameTextA ( LONG  lParam,
LPSTR  lpString,
int  nSize 
)

Definition at line 561 of file input.c.

564{
565 LPWSTR pwszBuf;
566 UINT cchBuf = 0;
567 int iRet = 0;
568 BOOL defChar = FALSE;
569
570 pwszBuf = HeapAlloc(GetProcessHeap(), 0, nSize * sizeof(WCHAR));
571 if (!pwszBuf)
572 return 0;
573
574 cchBuf = NtUserGetKeyNameText(lParam, pwszBuf, nSize);
575
576 iRet = WideCharToMultiByte(CP_ACP, 0,
577 pwszBuf, cchBuf,
578 lpString, nSize, ".", &defChar); // FIXME: do we need defChar?
579 lpString[iRet] = 0;
580 HeapFree(GetProcessHeap(), 0, pwszBuf);
581
582 return iRet;
583}
LPARAM lParam
Definition: combotst.c:139
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD NTAPI NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int nSize)
Definition: keyboard.c:1584
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2084
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ GetKeyNameTextW()

int WINAPI GetKeyNameTextW ( LONG  lParam,
LPWSTR  lpString,
int  nSize 
)

Definition at line 589 of file input.c.

592{
593 return NtUserGetKeyNameText(lParam, lpString, nSize);
594}

◆ GetKeyState()

SHORT WINAPI DECLSPEC_HOTPATCH GetKeyState ( int  nVirtKey)

Definition at line 602 of file input.c.

603{
604 return (SHORT)NtUserGetKeyState((DWORD)nVirtKey);
605}
SHORT NTAPI NtUserGetKeyState(INT VirtKey)
Definition: msgqueue.c:2556

◆ GetLastInputInfo()

BOOL WINAPI GetLastInputInfo ( PLASTINPUTINFO  plii)

Definition at line 652 of file input.c.

653{
654 TRACE("%p\n", plii);
655
656 if (plii->cbSize != sizeof (*plii))
657 {
659 return FALSE;
660 }
661
662 plii->dwTime = gpsi->dwLastRITEventTickCount;
663 return TRUE;
664}
PSERVERINFO gpsi
Definition: imm.c:18
#define TRACE(s)
Definition: solgame.cpp:4
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

◆ GetSystemLibraryPath()

VOID GetSystemLibraryPath ( LPWSTR  pszPath,
INT  cchPath,
LPCWSTR  pszFileName 
)

Definition at line 689 of file input.c.

690{
691 WCHAR szSysDir[MAX_PATH];
692 GetSystemDirectoryW(szSysDir, _countof(szSysDir));
693 StringCchPrintfW(pszPath, cchPath, L"%s\\%s", szSysDir, pszFileName);
694}
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44

Referenced by IntLoadKeyboardLayout().

◆ IntLoadKeyboardLayout()

HKL APIENTRY IntLoadKeyboardLayout ( _In_ HKL  hklUnload,
_In_z_ LPCWSTR  pwszKLID,
_In_ LANGID  wLangID,
_In_ UINT  Flags,
_In_ BOOL  unknown5 
)

Definition at line 705 of file input.c.

711{
712 DWORD dwKLID, dwHKL, dwType, dwSize;
713 UNICODE_STRING ustrKLID;
714 WCHAR wszRegKey[256] = L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
715 WCHAR wszLayoutId[10], wszNewKLID[KL_NAMELENGTH], szImeFileName[80];
716 HKL hNewKL;
717 HKEY hKey;
718 BOOL bIsIME;
719 WORD wLow, wHigh;
720
721 if (!IsValidKLID(pwszKLID))
722 {
723 ERR("pwszKLID: %s\n", debugstr_w(pwszKLID));
725 }
726
727 dwKLID = wcstoul(pwszKLID, NULL, 16);
728 bIsIME = IS_IME_HKL(UlongToHandle(dwKLID));
729
730 wLow = LOWORD(dwKLID);
731 wHigh = HIWORD(dwKLID);
732
734 {
735 /* Check substitutes key */
736 if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Substitutes", 0,
738 {
739 dwSize = sizeof(wszNewKLID);
740 if (RegQueryValueExW(hKey, pwszKLID, NULL, &dwType, (LPBYTE)wszNewKLID,
741 &dwSize) == ERROR_SUCCESS &&
742 dwType == REG_SZ)
743 {
744 /* Use new KLID value */
745 pwszKLID = wszNewKLID;
746 dwKLID = wcstoul(pwszKLID, NULL, 16);
747 wHigh = LOWORD(dwKLID);
748 }
749
750 /* Close the key now */
752 }
753 }
754
755 /* Append KLID at the end of registry key */
756 StringCbCatW(wszRegKey, sizeof(wszRegKey), pwszKLID);
757
758 /* Open layout registry key for read */
760 {
761 dwSize = sizeof(wszLayoutId);
762 if (RegQueryValueExW(hKey, L"Layout Id", NULL, &dwType, (LPBYTE)wszLayoutId,
763 &dwSize) == ERROR_SUCCESS && dwType == REG_SZ)
764 {
765 /* If Layout Id is specified, use this value | f000 as HIWORD */
766 wHigh = (0xF000 | wcstoul(wszLayoutId, NULL, 16));
767 }
768
769 if (bIsIME)
770 {
771 /* Check "IME File" value */
772 dwSize = sizeof(szImeFileName);
773 if (RegQueryValueExW(hKey, L"IME File", NULL, &dwType, (LPBYTE)szImeFileName,
775 {
776 bIsIME = FALSE;
777 wHigh = 0;
778 ERR("0x%X\n", dwKLID);
779 }
780 else
781 {
783 szImeFileName[_countof(szImeFileName) - 1] = UNICODE_NULL;
784 GetSystemLibraryPath(szPath, _countof(szPath), szImeFileName);
785
786 /* We don't allow the invalid "IME File" values due to security reason */
787 if (dwType != REG_SZ || szImeFileName[0] == 0 ||
788 wcscspn(szImeFileName, L":\\/") != wcslen(szImeFileName) ||
789 GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES) /* Does not exist? */
790 {
791 bIsIME = FALSE;
792 wHigh = 0;
793 ERR("'%s'\n", debugstr_w(szPath));
794 }
795 }
796 }
797
798 /* Close the key now */
800 }
801 else
802 {
803 ERR("Could not find keyboard layout %S.\n", pwszKLID);
804 return NULL;
805 }
806
807 if (wHigh == 0)
808 wHigh = wLow;
809
810 dwHKL = MAKELONG(wLow, wHigh);
811
812 RtlInitUnicodeString(&ustrKLID, pwszKLID);
813 hNewKL = NtUserLoadKeyboardLayoutEx(NULL, 0, NULL, hklUnload, &ustrKLID, dwHKL, Flags);
815 return hNewKL;
816}
#define ERR(fmt,...)
Definition: precomp.h:57
#define UlongToHandle(ul)
Definition: basetsd.h:97
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
unsigned short WORD
Definition: ntddk_ex.h:93
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HKL NTAPI NtUserLoadKeyboardLayoutEx(IN HANDLE hFile, IN DWORD offTable, IN PVOID pTables, IN HKL hOldKL, IN PUNICODE_STRING puszKLID, IN DWORD dwNewKL, IN UINT Flags)
Definition: kbdlayout.c:1161
#define debugstr_w
Definition: kernel32.h:32
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define UNICODE_NULL
_Check_return_ _CRTIMP size_t __cdecl wcscspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
VOID APIENTRY CliImmInitializeHotKeys(DWORD dwAction, HKL hKL)
Definition: input.c:402
#define ENGLISH_US
Definition: input.c:696
VOID GetSystemLibraryPath(LPWSTR pszPath, INT cchPath, LPCWSTR pszFileName)
Definition: input.c:689
static BOOL IsValidKLID(_In_ LPCWSTR pwszKLID)
Definition: input.c:684
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by LoadKeyboardLayoutEx(), and LoadKeyboardLayoutW().

◆ IntLoadPreloadKeyboardLayouts()

VOID IntLoadPreloadKeyboardLayouts ( VOID  )

Definition at line 148 of file input.c.

149{
150 UINT nNumber, uFlags;
151 DWORD cbValue, dwType;
152 WCHAR szNumber[32], szValue[KL_NAMELENGTH];
153 HKEY hPreloadKey;
154 BOOL bOK = FALSE;
155 HKL hKL, hDefaultKL = NULL;
156
158 L"Keyboard Layout\\Preload",
159 &hPreloadKey) != ERROR_SUCCESS)
160 {
161 return;
162 }
163
164 for (nNumber = 1; nNumber <= 1000; ++nNumber)
165 {
166 _ultow(nNumber, szNumber, 10);
167
168 cbValue = sizeof(szValue);
169 if (RegQueryValueExW(hPreloadKey,
170 szNumber,
171 NULL,
172 &dwType,
173 (LPBYTE)szValue,
174 &cbValue) != ERROR_SUCCESS)
175 {
176 break;
177 }
178
179 if (dwType != REG_SZ)
180 continue;
181
182 if (nNumber == 1) /* The first entry is for default keyboard layout */
183 uFlags = KLF_SUBSTITUTE_OK | KLF_ACTIVATE | KLF_RESET;
184 else
186
187 hKL = LoadKeyboardLayoutW(szValue, uFlags);
188 if (hKL)
189 {
190 bOK = TRUE;
191 if (nNumber == 1) /* The first entry */
192 hDefaultKL = hKL;
193 }
194 }
195
196 RegCloseKey(hPreloadKey);
197
198 if (hDefaultKL)
199 SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &hDefaultKL, 0);
200
201 if (!bOK)
202 {
203 /* Fallback to English (US) */
204 LoadKeyboardLayoutW(L"00000409", KLF_SUBSTITUTE_OK | KLF_ACTIVATE | KLF_RESET);
205 }
206}
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
UINT uFlags
Definition: api.c:59
HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags)
Definition: input.c:822
#define KLF_REPLACELANG
Definition: winuser.h:115
#define KLF_ACTIVATE
Definition: winuser.h:111
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define KLF_NOTELLSHELL
Definition: winuser.h:116

Referenced by UpdatePerUserSystemParameters().

◆ IntSetFeKeyboardFlags()

VOID FASTCALL IntSetFeKeyboardFlags ( LANGID  LangID,
PBYTE  pbFlags 
)

Definition at line 70 of file input.c.

71{
72 switch (LangID)
73 {
75 *pbFlags |= FE_JAPANESE;
76 break;
77
80 *pbFlags |= FE_CHINESE_TRADITIONAL;
81 break;
82
85 *pbFlags |= FE_CHINESE_SIMPLIFIED;
86 break;
87
89 *pbFlags |= FE_KOREAN;
90 break;
91
92 default:
93 break;
94 }
95}
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_CHINESE_SINGAPORE
Definition: nls.h:211
#define SUBLANG_CHINESE_TRADITIONAL
Definition: nls.h:208
#define SUBLANG_CHINESE_SIMPLIFIED
Definition: nls.h:209
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define SUBLANG_CHINESE_HONGKONG
Definition: nls.h:210
#define LANG_CHINESE
Definition: nls.h:42
#define LANG_JAPANESE
Definition: nls.h:76
#define LANG_KOREAN
Definition: nls.h:84
#define SUBLANG_KOREAN
Definition: nls.h:280
#define FE_KOREAN
Definition: input.c:66

Referenced by CliGetPreloadKeyboardLayouts(), and CliImmInitializeHotKeys().

◆ IsValidKLID()

static BOOL IsValidKLID ( _In_ LPCWSTR  pwszKLID)
inlinestatic

Definition at line 684 of file input.c.

685{
686 return (pwszKLID != NULL) && (wcsspn(pwszKLID, L"0123456789ABCDEFabcdef") == (KL_NAMELENGTH - 1));
687}
_Check_return_ _CRTIMP size_t __cdecl wcsspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)

Referenced by IntLoadKeyboardLayout().

◆ keybd_event()

VOID WINAPI keybd_event ( BYTE  bVk,
BYTE  bScan,
DWORD  dwFlags,
ULONG_PTR  dwExtraInfo 
)

Definition at line 1076 of file input.c.

1081{
1082 INPUT Input;
1083
1084 Input.type = INPUT_KEYBOARD;
1085 Input.ki.wVk = bVk;
1086 Input.ki.wScan = bScan;
1087 Input.ki.dwFlags = dwFlags;
1088 Input.ki.time = 0;
1089 Input.ki.dwExtraInfo = dwExtraInfo;
1090
1091 NtUserSendInput(1, &Input, sizeof(INPUT));
1092}
UINT NTAPI NtUserSendInput(UINT nInputs, LPINPUT pInput, INT cbSize)
Definition: input.c:708
@ Input
Definition: arc.h:84
#define INPUT_KEYBOARD
Definition: winable.h:10
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
BOOL bScan
Definition: wlanconf.c:23

◆ LoadKeyboardLayoutA()

HKL WINAPI LoadKeyboardLayoutA ( LPCSTR  pszKLID,
UINT  Flags 
)

Definition at line 670 of file input.c.

672{
673 WCHAR wszKLID[16];
674
675 if (!MultiByteToWideChar(CP_ACP, 0, pszKLID, -1,
676 wszKLID, sizeof(wszKLID)/sizeof(wszKLID[0])))
677 {
678 return FALSE;
679 }
680
681 return LoadKeyboardLayoutW(wszKLID, Flags);
682}
#define MultiByteToWideChar
Definition: compat.h:110

◆ LoadKeyboardLayoutEx()

HKL WINAPI LoadKeyboardLayoutEx ( HKL  hklUnload,
LPCWSTR  pwszKLID,
UINT  Flags 
)

Definition at line 833 of file input.c.

836{
837 FIXME("(%p, %s, 0x%X)", hklUnload, debugstr_w(pwszKLID), Flags);
838 if (!hklUnload)
839 return NULL;
840 return IntLoadKeyboardLayout(hklUnload, pwszKLID, 0, Flags, FALSE);
841}
#define FIXME(fmt,...)
Definition: precomp.h:53
HKL APIENTRY IntLoadKeyboardLayout(_In_ HKL hklUnload, _In_z_ LPCWSTR pwszKLID, _In_ LANGID wLangID, _In_ UINT Flags, _In_ BOOL unknown5)
Definition: input.c:705

◆ LoadKeyboardLayoutW()

HKL WINAPI LoadKeyboardLayoutW ( LPCWSTR  pwszKLID,
UINT  Flags 
)

Definition at line 822 of file input.c.

824{
825 TRACE("(%s, 0x%X)\n", debugstr_w(pwszKLID), Flags);
826 return IntLoadKeyboardLayout(NULL, pwszKLID, 0, Flags, FALSE);
827}

Referenced by IntLoadPreloadKeyboardLayouts(), and LoadKeyboardLayoutA().

◆ MapVirtualKeyA()

UINT WINAPI MapVirtualKeyA ( UINT  uCode,
UINT  uMapType 
)

Definition at line 859 of file input.c.

861{
862 return MapVirtualKeyExA(uCode, uMapType, GetKeyboardLayout(0));
863}
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
UINT WINAPI MapVirtualKeyExA(_In_ UINT, _In_ UINT, _In_opt_ HKL)

◆ MapVirtualKeyExA()

UINT WINAPI MapVirtualKeyExA ( UINT  uCode,
UINT  uMapType,
HKL  dwhkl 
)

Definition at line 869 of file input.c.

872{
873 return MapVirtualKeyExW(uCode, uMapType, dwhkl);
874}
UINT WINAPI MapVirtualKeyExW(UINT uCode, UINT uMapType, HKL dwhkl)
Definition: input.c:881

◆ MapVirtualKeyExW()

UINT WINAPI MapVirtualKeyExW ( UINT  uCode,
UINT  uMapType,
HKL  dwhkl 
)

Definition at line 881 of file input.c.

884{
885 return NtUserMapVirtualKeyEx(uCode, uMapType, 0, dwhkl);
886}
UINT NTAPI NtUserMapVirtualKeyEx(UINT keyCode, UINT transType, DWORD keyboardId, HKL dwhkl)
Definition: keyboard.c:1439

Referenced by MapVirtualKeyExA(), and MapVirtualKeyW().

◆ MapVirtualKeyW()

UINT WINAPI MapVirtualKeyW ( UINT  uCode,
UINT  uMapType 
)

Definition at line 893 of file input.c.

895{
896 return MapVirtualKeyExW(uCode, uMapType, GetKeyboardLayout(0));
897}

◆ mouse_event()

VOID WINAPI mouse_event ( DWORD  dwFlags,
DWORD  dx,
DWORD  dy,
DWORD  dwData,
ULONG_PTR  dwExtraInfo 
)

Definition at line 1100 of file input.c.

1106{
1107 INPUT Input;
1108
1109 Input.type = INPUT_MOUSE;
1110 Input.mi.dx = dx;
1111 Input.mi.dy = dy;
1112 Input.mi.mouseData = dwData;
1113 Input.mi.dwFlags = dwFlags;
1114 Input.mi.time = 0;
1115 Input.mi.dwExtraInfo = dwExtraInfo;
1116
1117 NtUserSendInput(1, &Input, sizeof(INPUT));
1118}
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define INPUT_MOUSE
Definition: winable.h:9

◆ OemKeyScan()

DWORD WINAPI OemKeyScan ( WORD  wOemChar)

Definition at line 904 of file input.c.

905{
906 WCHAR p;
907 SHORT Vk;
908 UINT Scan;
909
910 MultiByteToWideChar(CP_OEMCP, 0, (PCSTR)&wOemChar, 1, &p, 1);
911 Vk = VkKeyScanW(p);
912 Scan = MapVirtualKeyW((Vk & 0x00ff), 0);
913 if (!Scan) return -1;
914 /*
915 Page 450-1, MS W2k SuperBible by SAMS. Return, low word has the
916 scan code and high word has the shift state.
917 */
918 return ((Vk & 0xff00) << 8) | Scan;
919}
GLfloat GLfloat p
Definition: glext.h:8902
const char * PCSTR
Definition: typedefs.h:52
#define CP_OEMCP
Definition: winnls.h:231
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
SHORT WINAPI VkKeyScanW(_In_ WCHAR)

◆ SetDoubleClickTime()

BOOL WINAPI SetDoubleClickTime ( UINT  uInterval)

Definition at line 926 of file input.c.

927{
929 uInterval,
930 NULL,
931 0);
932}
BOOL NTAPI NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2168
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1384

◆ SwapMouseButton()

BOOL WINAPI SwapMouseButton ( BOOL  fSwap)

Definition at line 940 of file input.c.

942{
943 return NtUserxSwapMouseButton(fSwap);
944}
EXTINLINE BOOL NtUserxSwapMouseButton(BOOL fSwap)
Definition: ntwrapper.h:596

◆ ToAscii()

int WINAPI ToAscii ( UINT  uVirtKey,
UINT  uScanCode,
CONST BYTE lpKeyState,
LPWORD  lpChar,
UINT  uFlags 
)

Definition at line 951 of file input.c.

956{
957 return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
958}
int WINAPI ToAsciiEx(_In_ UINT, _In_ UINT, _In_reads_opt_(256) CONST BYTE *, _Out_ LPWORD, _In_ UINT, _In_opt_ HKL)

◆ ToAsciiEx()

int WINAPI ToAsciiEx ( UINT  uVirtKey,
UINT  uScanCode,
CONST BYTE lpKeyState,
LPWORD  lpChar,
UINT  uFlags,
HKL  dwhkl 
)

Definition at line 965 of file input.c.

971{
972 WCHAR UniChars[2];
973 int Ret, CharCount;
974
975 Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl);
976 CharCount = (Ret < 0 ? 1 : Ret);
977 WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR)lpChar, 2, NULL, NULL);
978
979 return Ret;
980}
int WINAPI ToUnicodeEx(_In_ UINT wVirtKey, _In_ UINT wScanCode, _In_reads_bytes_(256) CONST BYTE *lpKeyState, _Out_writes_(cchBuff) LPWSTR pwszBuff, _In_ int cchBuff, _In_ UINT wFlags, _In_opt_ HKL dwhkl)
char * LPSTR
Definition: xmlstorage.h:182

◆ ToUnicode()

int WINAPI ToUnicode ( UINT  wVirtKey,
UINT  wScanCode,
CONST BYTE lpKeyState,
LPWSTR  pwszBuff,
int  cchBuff,
UINT  wFlags 
)

Definition at line 987 of file input.c.

993{
994 return ToUnicodeEx(wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
995 wFlags, 0);
996}
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ ToUnicodeEx()

int WINAPI ToUnicodeEx ( UINT  wVirtKey,
UINT  wScanCode,
CONST BYTE lpKeyState,
LPWSTR  pwszBuff,
int  cchBuff,
UINT  wFlags,
HKL  dwhkl 
)

Definition at line 1003 of file input.c.

1010{
1011 return NtUserToUnicodeEx(wVirtKey, wScanCode, (PBYTE)lpKeyState, pwszBuff, cchBuff,
1012 wFlags, dwhkl);
1013}
INT NTAPI NtUserToUnicodeEx(UINT wVirtKey, UINT wScanCode, PBYTE lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
BYTE * PBYTE
Definition: pedump.c:66

◆ UnloadKeyboardLayout()

BOOL WINAPI UnloadKeyboardLayout ( HKL  hKL)

Definition at line 846 of file input.c.

847{
849 return FALSE;
850
852 return TRUE;
853}
BOOL NTAPI NtUserUnloadKeyboardLayout(HKL hKl)
Definition: kbdlayout.c:1251

◆ VkKeyScanA()

SHORT WINAPI VkKeyScanA ( CHAR  ch)

Definition at line 1021 of file input.c.

1022{
1023 WCHAR wChar;
1024
1025 if (IsDBCSLeadByte(ch))
1026 return -1;
1027
1028 MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
1029 return VkKeyScanW(wChar);
1030}
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
Definition: locale.c:2123

◆ VkKeyScanExA()

SHORT WINAPI VkKeyScanExA ( CHAR  ch,
HKL  dwhkl 
)

Definition at line 1037 of file input.c.

1039{
1040 WCHAR wChar;
1041
1042 if (IsDBCSLeadByte(ch))
1043 return -1;
1044
1045 MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
1046 return VkKeyScanExW(wChar, dwhkl);
1047}
SHORT WINAPI VkKeyScanExW(WCHAR ch, HKL dwhkl)
Definition: input.c:1054

◆ VkKeyScanExW()

SHORT WINAPI VkKeyScanExW ( WCHAR  ch,
HKL  dwhkl 
)

Definition at line 1054 of file input.c.

1056{
1057 return (SHORT)NtUserVkKeyScanEx(ch, dwhkl, TRUE);
1058}
DWORD NTAPI NtUserVkKeyScanEx(WCHAR wChar, HKL KeyboardLayout, BOOL bUsehHK)
Definition: keyboard.c:1709

Referenced by VkKeyScanExA().

◆ VkKeyScanW()

SHORT WINAPI VkKeyScanW ( WCHAR  ch)

Definition at line 1065 of file input.c.

1066{
1067 return (SHORT)NtUserVkKeyScanEx(ch, 0, FALSE);
1068}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ DefaultHotKeyTableC

IMEHOTKEYENTRY DefaultHotKeyTableC[]
Initial value:
=
{
}
#define IME_CHOTKEY_IME_NONIME_TOGGLE
Definition: imm.h:195
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
#define IME_CHOTKEY_SHAPE_TOGGLE
Definition: imm.h:196
#define VK_SPACE
Definition: winuser.h:2222

Definition at line 56 of file input.c.

Referenced by CliImmInitializeHotKeys().

◆ DefaultHotKeyTableJ

IMEHOTKEYENTRY DefaultHotKeyTableJ[]
Initial value:
=
{
}
#define IME_JHOTKEY_CLOSE_OPEN
Definition: imm.h:200
#define MOD_IGNORE_ALL_MODIFIER
Definition: imm.h:192
#define VK_KANJI
Definition: winuser.h:2216

Definition at line 43 of file input.c.

Referenced by CliImmInitializeHotKeys().

◆ DefaultHotKeyTableT

IMEHOTKEYENTRY DefaultHotKeyTableT[]
Initial value:

Definition at line 49 of file input.c.

Referenced by CliImmInitializeHotKeys().