ReactOS  0.4.14-dev-41-g31d7680
input.c File Reference
#include <user32.h>
#include <strsafe.h>
Include dependency graph for input.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
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)
 
HKL WINAPI LoadKeyboardLayoutW (LPCWSTR pwszKLID, UINT Flags)
 
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)
 

Function Documentation

◆ DragDetect()

BOOL WINAPI DragDetect ( HWND  hWnd,
POINT  pt 
)

Definition at line 39 of file input.c.

42 {
43  return NtUserDragDetect(hWnd, pt);
44 #if 0
45  MSG msg;
46  RECT rect;
47  POINT tmp;
50 
51  rect.left = pt.x - dx;
52  rect.right = pt.x + dx;
53  rect.top = pt.y - dy;
54  rect.bottom = pt.y + dy;
55 
57 
58  for (;;)
59  {
60  while (
63  )
64  {
65  if (msg.message == WM_LBUTTONUP)
66  {
68  return FALSE;
69  }
70  if (msg.message == WM_MOUSEMOVE)
71  {
72  tmp.x = LOWORD(msg.lParam);
73  tmp.y = HIWORD(msg.lParam);
74  if (!PtInRect(&rect, tmp))
75  {
77  return TRUE;
78  }
79  }
80  if (msg.message == WM_KEYDOWN)
81  {
82  if (msg.wParam == VK_ESCAPE)
83  {
85  return TRUE;
86  }
87  }
88  }
89  WaitMessage();
90  }
91  return 0;
92 #endif
93 }
#define TRUE
Definition: types.h:120
#define WM_MOUSEFIRST
Definition: winuser.h:1756
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
GLint dy
Definition: linetemp.h:97
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HWND hWnd
Definition: settings.c:17
#define VK_ESCAPE
Definition: winuser.h:2189
& rect
Definition: startmenu.cpp:1413
#define WM_KEYFIRST
Definition: winuser.h:1696
#define WM_KEYDOWN
Definition: winuser.h:1697
#define SM_CXDRAG
Definition: winuser.h:1018
#define WM_MOUSELAST
Definition: winuser.h:1783
int WINAPI GetSystemMetrics(_In_ int)
#define WM_KEYLAST
Definition: winuser.h:1710
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define WM_MOUSEMOVE
Definition: winuser.h:1757
GLint dx
Definition: linetemp.h:97
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
#define HIWORD(l)
Definition: typedefs.h:246
unsigned int ULONG
Definition: retypes.h:1
#define SM_CYDRAG
Definition: winuser.h:1019
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define LOWORD(l)
Definition: pedump.c:82
BOOL NTAPI NtUserDragDetect(HWND hWnd, POINT pt)
Definition: message.c:1993

◆ EnableWindow()

BOOL WINAPI EnableWindow ( HWND  hWnd,
BOOL  bEnable 
)

Definition at line 99 of file input.c.

100 {
102 }
HWND hWnd
Definition: settings.c:17
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 110 of file input.c.

111 {
112  if (vKey < 0 || vKey > 256)
113  return 0;
114  return (SHORT)NtUserGetAsyncKeyState((DWORD)vKey);
115 }
short SHORT
Definition: pedump.c:59
unsigned long DWORD
Definition: ntddk_ex.h:95
SHORT NTAPI NtUserGetAsyncKeyState(INT Key)
Definition: keyboard.c:632

Referenced by hook_proc(), and test_get_async_key_state().

◆ GetKBCodePage()

UINT WINAPI GetKBCodePage ( VOID  )

Definition at line 132 of file input.c.

133 {
134  return GetOEMCP();
135 }
UINT WINAPI GetOEMCP(VOID)
Definition: nls.c:2184

◆ GetKeyboardLayout()

HKL WINAPI GetKeyboardLayout ( DWORD  idThread)

Definition at line 122 of file input.c.

123 {
124  return NtUserxGetKeyboardLayout(idThread);
125 }
EXTINLINE HKL NtUserxGetKeyboardLayout(DWORD idThread)
Definition: ntwrapper.h:626

Referenced by MapVirtualKeyA(), MapVirtualKeyW(), test_Input_blackbox(), test_key_map(), test_keyboard_layout_name(), test_ToAscii(), and test_ToUnicode().

◆ GetKeyboardLayoutNameA()

BOOL WINAPI GetKeyboardLayoutNameA ( LPSTR  pwszKLID)

Definition at line 192 of file input.c.

193 {
195 
197  return FALSE;
198 
199  if (!WideCharToMultiByte(CP_ACP, 0, buf, -1, pwszKLID, KL_NAMELENGTH, NULL, NULL))
200  return FALSE;
201 
202  return TRUE;
203 }
#define TRUE
Definition: types.h:120
#define KL_NAMELENGTH
Definition: winuser.h:122
#define WideCharToMultiByte
Definition: compat.h:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI GetKeyboardLayoutNameW(LPWSTR pwszKLID)
Definition: input.c:209

Referenced by test_keyboard_layout_name().

◆ GetKeyboardLayoutNameW()

BOOL WINAPI GetKeyboardLayoutNameW ( LPWSTR  pwszKLID)

Definition at line 209 of file input.c.

210 {
211  return NtUserGetKeyboardLayoutName(pwszKLID);
212 }
BOOL NTAPI NtUserGetKeyboardLayoutName(LPWSTR lpszName)
Definition: kbdlayout.c:557

Referenced by GetKeyboardLayoutNameA(), and test_keyboard_layout_name().

◆ GetKeyboardType()

int WINAPI GetKeyboardType ( int  nTypeFlag)

Definition at line 218 of file input.c.

219 {
220  return NtUserxGetKeyboardType(nTypeFlag);
221 }
EXTINLINE INT NtUserxGetKeyboardType(INT nTypeFlag)
Definition: ntwrapper.h:631

◆ GetKeyNameTextA()

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

Definition at line 142 of file input.c.

145 {
146  LPWSTR pwszBuf;
147  UINT cchBuf = 0;
148  int iRet = 0;
149  BOOL defChar = FALSE;
150 
151  pwszBuf = HeapAlloc(GetProcessHeap(), 0, nSize * sizeof(WCHAR));
152  if (!pwszBuf)
153  return 0;
154 
155  cchBuf = NtUserGetKeyNameText(lParam, pwszBuf, nSize);
156 
157  iRet = WideCharToMultiByte(CP_ACP, 0,
158  pwszBuf, cchBuf,
159  lpString, nSize, ".", &defChar); // FIXME: do we need defChar?
160  lpString[iRet] = 0;
161  HeapFree(GetProcessHeap(), 0, pwszBuf);
162 
163  return iRet;
164 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2024
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
DWORD NTAPI NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int nSize)
Definition: keyboard.c:1416

Referenced by test_key_names(), and test_keynames().

◆ GetKeyNameTextW()

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

Definition at line 170 of file input.c.

173 {
174  return NtUserGetKeyNameText(lParam, lpString, nSize);
175 }
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2024
LPARAM lParam
Definition: combotst.c:139
DWORD NTAPI NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int nSize)
Definition: keyboard.c:1416

Referenced by test_key_names().

◆ GetKeyState()

SHORT WINAPI DECLSPEC_HOTPATCH GetKeyState ( int  nVirtKey)

Definition at line 183 of file input.c.

184 {
185  return (SHORT)NtUserGetKeyState((DWORD)nVirtKey);
186 }
short SHORT
Definition: pedump.c:59
SHORT NTAPI NtUserGetKeyState(INT VirtKey)
Definition: msgqueue.c:2573
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by get_key_state_thread().

◆ GetLastInputInfo()

BOOL WINAPI GetLastInputInfo ( PLASTINPUTINFO  plii)

Definition at line 227 of file input.c.

228 {
229  TRACE("%p\n", plii);
230 
231  if (plii->cbSize != sizeof (*plii))
232  {
234  return FALSE;
235  }
236 
237  plii->dwTime = gpsi->dwLastRITEventTickCount;
238  return TRUE;
239 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
PSERVERINFO gpsi
Definition: main.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:409

◆ keybd_event()

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

Definition at line 554 of file input.c.

559 {
560  INPUT Input;
561 
562  Input.type = INPUT_KEYBOARD;
563  Input.ki.wVk = bVk;
564  Input.ki.wScan = bScan;
565  Input.ki.dwFlags = dwFlags;
566  Input.ki.time = 0;
567  Input.ki.dwExtraInfo = dwExtraInfo;
568 
569  NtUserSendInput(1, &Input, sizeof(INPUT));
570 }
Definition: arc.h:84
#define INPUT_KEYBOARD
Definition: winable.h:10
UINT APIENTRY NtUserSendInput(UINT nInputs, LPINPUT pInput, INT cbSize)
Definition: input.c:707
BOOL bScan
Definition: wlanconf.c:24
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Referenced by test_GetKeyState().

◆ LoadKeyboardLayoutA()

HKL WINAPI LoadKeyboardLayoutA ( LPCSTR  pszKLID,
UINT  Flags 
)

Definition at line 245 of file input.c.

247 {
248  WCHAR wszKLID[16];
249 
250  if (!MultiByteToWideChar(CP_ACP, 0, pszKLID, -1,
251  wszKLID, sizeof(wszKLID)/sizeof(wszKLID[0])))
252  {
253  return FALSE;
254  }
255 
256  return LoadKeyboardLayoutW(wszKLID, Flags);
257 }
HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags)
Definition: input.c:263
#define CP_ACP
Definition: compat.h:99
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100

◆ LoadKeyboardLayoutW()

HKL WINAPI LoadKeyboardLayoutW ( LPCWSTR  pwszKLID,
UINT  Flags 
)

Definition at line 263 of file input.c.

265 {
266  DWORD dwhkl, dwType, dwSize;
267  UNICODE_STRING ustrKbdName;
268  UNICODE_STRING ustrKLID;
269  WCHAR wszRegKey[256] = L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
270  WCHAR wszLayoutId[10], wszNewKLID[10];
271  HKEY hKey;
272 
273  /* LOWORD of dwhkl is Locale Identifier */
274  dwhkl = LOWORD(wcstoul(pwszKLID, NULL, 16));
275 
276  if (Flags & KLF_SUBSTITUTE_OK)
277  {
278  /* Check substitutes key */
279  if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Substitutes", 0,
280  KEY_READ, &hKey) == ERROR_SUCCESS)
281  {
282  dwSize = sizeof(wszNewKLID);
283  if (RegQueryValueExW(hKey, pwszKLID, NULL, &dwType, (LPBYTE)wszNewKLID, &dwSize) == ERROR_SUCCESS)
284  {
285  /* Use new KLID value */
286  pwszKLID = wszNewKLID;
287  }
288 
289  /* Close the key now */
290  RegCloseKey(hKey);
291  }
292  }
293 
294  /* Append KLID at the end of registry key */
295  StringCbCatW(wszRegKey, sizeof(wszRegKey), pwszKLID);
296 
297  /* Open layout registry key for read */
298  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRegKey, 0,
299  KEY_READ, &hKey) == ERROR_SUCCESS)
300  {
301  dwSize = sizeof(wszLayoutId);
302  if (RegQueryValueExW(hKey, L"Layout Id", NULL, &dwType, (LPBYTE)wszLayoutId, &dwSize) == ERROR_SUCCESS)
303  {
304  /* If Layout Id is specified, use this value | f000 as HIWORD */
305  /* FIXME: Microsoft Office expects this value to be something specific
306  * for Japanese and Korean Windows with an IME the value is 0xe001
307  * We should probably check to see if an IME exists and if so then
308  * set this word properly.
309  */
310  dwhkl |= (0xf000 | wcstol(wszLayoutId, NULL, 16)) << 16;
311  }
312 
313  /* Close the key now */
314  RegCloseKey(hKey);
315  }
316  else
317  {
318  ERR("Could not find keyboard layout %S.\n", pwszKLID);
319  return NULL;
320  }
321 
322  /* If Layout Id is not given HIWORD == LOWORD (for dwhkl) */
323  if (!HIWORD(dwhkl))
324  dwhkl |= dwhkl << 16;
325 
326  ZeroMemory(&ustrKbdName, sizeof(ustrKbdName));
327  RtlInitUnicodeString(&ustrKLID, pwszKLID);
328  return NtUserLoadKeyboardLayoutEx(NULL, 0, &ustrKbdName,
329  NULL, &ustrKLID,
330  dwhkl, Flags);
331 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define ZeroMemory
Definition: winbase.h:1635
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HKL NTAPI NtUserLoadKeyboardLayoutEx(IN HANDLE Handle, IN DWORD offTable, IN PUNICODE_STRING puszKeyboardName, IN HKL hKL, IN PUNICODE_STRING puszKLID, IN DWORD dwKLID, IN UINT Flags)
Definition: kbdlayout.c:596
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:109
#define HIWORD(l)
Definition: typedefs.h:246
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define LOWORD(l)
Definition: pedump.c:82
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by LoadKeyboardLayoutA().

◆ MapVirtualKeyA()

UINT WINAPI MapVirtualKeyA ( UINT  uCode,
UINT  uMapType 
)

Definition at line 337 of file input.c.

339 {
340  return MapVirtualKeyExA(uCode, uMapType, GetKeyboardLayout(0));
341 }
UINT WINAPI MapVirtualKeyExA(UINT uCode, UINT uMapType, HKL dwhkl)
Definition: input.c:347
HKL WINAPI GetKeyboardLayout(DWORD idThread)
Definition: input.c:122

◆ MapVirtualKeyExA()

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

Definition at line 347 of file input.c.

350 {
351  return MapVirtualKeyExW(uCode, uMapType, dwhkl);
352 }
UINT WINAPI MapVirtualKeyExW(UINT uCode, UINT uMapType, HKL dwhkl)
Definition: input.c:359

Referenced by MapVirtualKeyA(), and test_key_map().

◆ MapVirtualKeyExW()

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

Definition at line 359 of file input.c.

362 {
363  return NtUserMapVirtualKeyEx(uCode, uMapType, 0, dwhkl);
364 }
UINT NTAPI NtUserMapVirtualKeyEx(UINT keyCode, UINT transType, DWORD keyboardId, HKL dwhkl)
Definition: keyboard.c:1290

Referenced by MapVirtualKeyExA(), and MapVirtualKeyW().

◆ MapVirtualKeyW()

UINT WINAPI MapVirtualKeyW ( UINT  uCode,
UINT  uMapType 
)

Definition at line 371 of file input.c.

373 {
374  return MapVirtualKeyExW(uCode, uMapType, GetKeyboardLayout(0));
375 }
UINT WINAPI MapVirtualKeyExW(UINT uCode, UINT uMapType, HKL dwhkl)
Definition: input.c:359
HKL WINAPI GetKeyboardLayout(DWORD idThread)
Definition: input.c:122

Referenced by OemKeyScan(), test_OemKeyScan(), and test_ToUnicode().

◆ mouse_event()

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

Definition at line 578 of file input.c.

584 {
585  INPUT Input;
586 
587  Input.type = INPUT_MOUSE;
588  Input.mi.dx = dx;
589  Input.mi.dy = dy;
590  Input.mi.mouseData = dwData;
591  Input.mi.dwFlags = dwFlags;
592  Input.mi.time = 0;
593  Input.mi.dwExtraInfo = dwExtraInfo;
594 
595  NtUserSendInput(1, &Input, sizeof(INPUT));
596 }
GLint dy
Definition: linetemp.h:97
Definition: arc.h:84
static HANDLE ULONG_PTR dwData
Definition: file.c:35
UINT APIENTRY NtUserSendInput(UINT nInputs, LPINPUT pInput, INT cbSize)
Definition: input.c:707
#define INPUT_MOUSE
Definition: winable.h:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLint dx
Definition: linetemp.h:97

Referenced by test_mouse_ll_hook().

◆ OemKeyScan()

DWORD WINAPI OemKeyScan ( WORD  wOemChar)

Definition at line 382 of file input.c.

383 {
384  WCHAR p;
385  SHORT Vk;
386  UINT Scan;
387 
388  MultiByteToWideChar(CP_OEMCP, 0, (PCSTR)&wOemChar, 1, &p, 1);
389  Vk = VkKeyScanW(p);
390  Scan = MapVirtualKeyW((Vk & 0x00ff), 0);
391  if (!Scan) return -1;
392  /*
393  Page 450-1, MS W2k SuperBible by SAMS. Return, low word has the
394  scan code and high word has the shift state.
395  */
396  return ((Vk & 0xff00) << 8) | Scan;
397 }
SHORT WINAPI VkKeyScanW(WCHAR ch)
Definition: input.c:543
short SHORT
Definition: pedump.c:59
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
const char * PCSTR
Definition: typedefs.h:51
GLfloat GLfloat p
Definition: glext.h:8902
UINT WINAPI MapVirtualKeyW(UINT uCode, UINT uMapType)
Definition: input.c:371
#define CP_OEMCP
Definition: winnls.h:228

Referenced by test_OemKeyScan().

◆ SetDoubleClickTime()

BOOL WINAPI SetDoubleClickTime ( UINT  uInterval)

Definition at line 404 of file input.c.

405 {
407  uInterval,
408  NULL,
409  0);
410 }
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1363
BOOL NTAPI NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2129

◆ SwapMouseButton()

BOOL WINAPI SwapMouseButton ( BOOL  fSwap)

Definition at line 418 of file input.c.

420 {
421  return NtUserxSwapMouseButton(fSwap);
422 }
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 429 of file input.c.

434 {
435  return ToAsciiEx(uVirtKey, uScanCode, lpKeyState, lpChar, uFlags, 0);
436 }
UINT uFlags
Definition: api.c:60
int WINAPI ToAsciiEx(UINT uVirtKey, UINT uScanCode, CONST BYTE *lpKeyState, LPWORD lpChar, UINT uFlags, HKL dwhkl)
Definition: input.c:443

Referenced by test_ToAscii().

◆ ToAsciiEx()

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

Definition at line 443 of file input.c.

449 {
450  WCHAR UniChars[2];
451  int Ret, CharCount;
452 
453  Ret = ToUnicodeEx(uVirtKey, uScanCode, lpKeyState, UniChars, 2, uFlags, dwhkl);
454  CharCount = (Ret < 0 ? 1 : Ret);
455  WideCharToMultiByte(CP_ACP, 0, UniChars, CharCount, (LPSTR)lpChar, 2, NULL, NULL);
456 
457  return Ret;
458 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
UINT uFlags
Definition: api.c:60
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI ToUnicodeEx(UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
Definition: input.c:481

Referenced by test_ToAscii(), and ToAscii().

◆ ToUnicode()

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

Definition at line 465 of file input.c.

471 {
472  return ToUnicodeEx(wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
473  wFlags, 0);
474 }
int WINAPI ToUnicodeEx(UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
Definition: input.c:481
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519

Referenced by test_ToUnicode().

◆ ToUnicodeEx()

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

Definition at line 481 of file input.c.

488 {
489  return NtUserToUnicodeEx(wVirtKey, wScanCode, (PBYTE)lpKeyState, pwszBuff, cchBuff,
490  wFlags, dwhkl);
491 }
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
INT NTAPI NtUserToUnicodeEx(UINT wVirtKey, UINT wScanCode, PBYTE lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
BYTE * PBYTE
Definition: pedump.c:66

Referenced by ConioProcessKey(), test_ToUnicode(), ToAsciiEx(), and ToUnicode().

◆ VkKeyScanA()

SHORT WINAPI VkKeyScanA ( CHAR  ch)

Definition at line 499 of file input.c.

500 {
501  WCHAR wChar;
502 
503  if (IsDBCSLeadByte(ch))
504  return -1;
505 
506  MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
507  return VkKeyScanW(wChar);
508 }
#define CP_ACP
Definition: compat.h:99
SHORT WINAPI VkKeyScanW(WCHAR ch)
Definition: input.c:543
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2221
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100

◆ VkKeyScanExA()

SHORT WINAPI VkKeyScanExA ( CHAR  ch,
HKL  dwhkl 
)

Definition at line 515 of file input.c.

517 {
518  WCHAR wChar;
519 
520  if (IsDBCSLeadByte(ch))
521  return -1;
522 
523  MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wChar, 1);
524  return VkKeyScanExW(wChar, dwhkl);
525 }
#define CP_ACP
Definition: compat.h:99
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2221
__wchar_t WCHAR
Definition: xmlstorage.h:180
SHORT WINAPI VkKeyScanExW(WCHAR ch, HKL dwhkl)
Definition: input.c:532
#define MultiByteToWideChar
Definition: compat.h:100

◆ VkKeyScanExW()

SHORT WINAPI VkKeyScanExW ( WCHAR  ch,
HKL  dwhkl 
)

Definition at line 532 of file input.c.

534 {
535  return (SHORT)NtUserVkKeyScanEx(ch, dwhkl, TRUE);
536 }
#define TRUE
Definition: types.h:120
short SHORT
Definition: pedump.c:59
DWORD NTAPI NtUserVkKeyScanEx(WCHAR wChar, HKL KeyboardLayout, BOOL bUsehHK)
Definition: keyboard.c:1541

Referenced by VkKeyScanExA().

◆ VkKeyScanW()

SHORT WINAPI VkKeyScanW ( WCHAR  ch)

Definition at line 543 of file input.c.

544 {
545  return (SHORT)NtUserVkKeyScanEx(ch, 0, FALSE);
546 }
short SHORT
Definition: pedump.c:59
DWORD NTAPI NtUserVkKeyScanEx(WCHAR wChar, HKL KeyboardLayout, BOOL bUsehHK)
Definition: keyboard.c:1541

Referenced by OemKeyScan(), test_OemKeyScan(), test_ToUnicode(), and VkKeyScanA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )