ReactOS 0.4.16-dev-1007-g2e85425
input.c File Reference
#include "user_private.h"
#include "dbt.h"
#include "wine/debug.h"
#include "wine/plugplay.h"
Include dependency graph for input.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (win)
 
 WINE_DECLARE_DEBUG_CHANNEL (keyboard)
 
static HKL get_locale_kbd_layout (void)
 
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)
 
BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos (POINT *pt)
 
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture (void)
 
HWND WINAPI GetCapture (void)
 
BOOL WINAPI DestroyCaret (void)
 
BOOL WINAPI SetCaretPos (int x, int y)
 
BOOL WINAPI SetCaretBlinkTime (unsigned int time)
 
BOOL WINAPI GetInputState (void)
 
BOOL WINAPI GetLastInputInfo (PLASTINPUTINFO plii)
 
SHORT WINAPI VkKeyScanA (CHAR cChar)
 
SHORT WINAPI VkKeyScanW (WCHAR cChar)
 
WORD WINAPI VkKeyScanExA (CHAR cChar, HKL dwhkl)
 
DWORD WINAPI OemKeyScan (WORD oem)
 
INT WINAPI GetKeyboardType (INT nTypeFlag)
 
UINT WINAPI MapVirtualKeyA (UINT code, UINT maptype)
 
UINT WINAPI MapVirtualKeyW (UINT code, UINT maptype)
 
UINT WINAPI MapVirtualKeyExA (UINT code, UINT maptype, HKL hkl)
 
UINT WINAPI GetKBCodePage (void)
 
BOOL WINAPI GetKeyboardLayoutNameA (LPSTR pszKLID)
 
INT WINAPI GetKeyNameTextA (LONG lParam, LPSTR lpBuffer, INT nSize)
 
INT WINAPI ToUnicode (UINT virt, UINT scan, const BYTE *state, LPWSTR str, int size, UINT flags)
 
INT WINAPI ToAscii (UINT virtKey, UINT scanCode, const BYTE *lpKeyState, LPWORD lpChar, UINT flags)
 
INT WINAPI ToAsciiEx (UINT virtKey, UINT scanCode, const BYTE *lpKeyState, LPWORD lpChar, UINT flags, HKL dwhkl)
 
BOOL WINAPI BlockInput (BOOL fBlockIt)
 
HKL WINAPI LoadKeyboardLayoutW (const WCHAR *name, UINT flags)
 
HKL WINAPI LoadKeyboardLayoutA (LPCSTR pwszKLID, UINT Flags)
 
HKL WINAPI LoadKeyboardLayoutEx (HKL layout, const WCHAR *name, UINT flags)
 
BOOL WINAPI UnloadKeyboardLayout (HKL layout)
 
static DWORD CALLBACK devnotify_window_callbackW (HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
 
static DWORD CALLBACK devnotify_window_callbackA (HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
 
static DWORD CALLBACK devnotify_service_callback (HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
 
HDEVNOTIFY WINAPI RegisterDeviceNotificationA (HANDLE handle, void *filter, DWORD flags)
 
HDEVNOTIFY WINAPI RegisterDeviceNotificationW (HANDLE handle, void *filter, DWORD flags)
 
BOOL WINAPI UnregisterDeviceNotification (HDEVNOTIFY handle)
 
UINT WINAPI GetRawInputDeviceInfoA (HANDLE device, UINT command, void *data, UINT *size)
 
LRESULT WINAPI DefRawInputProc (RAWINPUT **data, INT data_count, UINT header_size)
 
BOOL WINAPI CloseTouchInputHandle (HTOUCHINPUT handle)
 
BOOL WINAPI GetTouchInputInfo (HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size)
 
BOOL WINAPI IsTouchWindow (HWND hwnd, ULONG *flags)
 
BOOL WINAPI RegisterTouchWindow (HWND hwnd, ULONG flags)
 
BOOL WINAPI UnregisterTouchWindow (HWND hwnd)
 
BOOL WINAPI CloseGestureInfoHandle (HGESTUREINFO handle)
 
BOOL WINAPI GetGestureExtraArgs (HGESTUREINFO handle, UINT count, BYTE *args)
 
BOOL WINAPI GetGestureInfo (HGESTUREINFO handle, GESTUREINFO *ptr)
 
BOOL WINAPI GetGestureConfig (HWND hwnd, DWORD reserved, DWORD flags, UINT *count, GESTURECONFIG *config, UINT size)
 
BOOL WINAPI SetGestureConfig (HWND hwnd, DWORD reserved, UINT count, GESTURECONFIG *config, UINT size)
 
BOOL WINAPI GetPointerTouchInfo (UINT32 id, POINTER_TOUCH_INFO *info)
 
BOOL WINAPI GetPointerTouchInfoHistory (UINT32 id, UINT32 *count, POINTER_TOUCH_INFO *info)
 
BOOL WINAPI SetForegroundWindow (HWND hwnd)
 
HWND WINAPI GetActiveWindow (void)
 
HWND WINAPI GetFocus (void)
 
BOOL WINAPI SetShellWindow (HWND hwnd)
 
HWND WINAPI GetShellWindow (void)
 
HWND WINAPI SetProgmanWindow (HWND hwnd)
 
HWND WINAPI GetProgmanWindow (void)
 
HWND WINAPI SetTaskmanWindow (HWND hwnd)
 
HWND WINAPI GetTaskmanWindow (void)
 
HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice (POINTER_INPUT_TYPE type, ULONG max_count, POINTER_FEEDBACK_MODE mode)
 

Function Documentation

◆ BlockInput()

BOOL WINAPI BlockInput ( BOOL  fBlockIt)

Definition at line 534 of file input.c.

535{
536 FIXME_(keyboard)("(%d): stub\n", fBlockIt);
538
539 return FALSE;
540}
#define FALSE
Definition: types.h:117
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define FIXME_(x)
Definition: compat.h:77
#define SetLastError(x)
Definition: compat.h:752

◆ CloseGestureInfoHandle()

BOOL WINAPI CloseGestureInfoHandle ( HGESTUREINFO  handle)

Definition at line 865 of file input.c.

866{
867 FIXME( "handle %p stub!\n", handle );
869 return FALSE;
870}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ CloseTouchInputHandle()

BOOL WINAPI CloseTouchInputHandle ( HTOUCHINPUT  handle)

Definition at line 818 of file input.c.

819{
820 FIXME( "handle %p stub!\n", handle );
822 return FALSE;
823}

◆ CreateSyntheticPointerDevice()

HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice ( POINTER_INPUT_TYPE  type,
ULONG  max_count,
POINTER_FEEDBACK_MODE  mode 
)

Definition at line 1015 of file input.c.

1016{
1017 FIXME( "type %ld, max_count %ld, mode %d stub!\n", type, max_count, mode);
1019 return NULL;
1020}
#define NULL
Definition: types.h:112
Character const *const size_t const max_count
Definition: fullpath.cpp:66
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum mode
Definition: glext.h:6217

◆ DefRawInputProc()

LRESULT WINAPI DefRawInputProc ( RAWINPUT **  data,
INT  data_count,
UINT  header_size 
)

Definition at line 807 of file input.c.

808{
809 TRACE( "data %p, data_count %d, header_size %u.\n", data, data_count, header_size );
810
811 return header_size == sizeof(RAWINPUTHEADER) ? 0 : -1;
812}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define TRACE(s)
Definition: solgame.cpp:4

◆ DestroyCaret()

◆ devnotify_service_callback()

static DWORD CALLBACK devnotify_service_callback ( HANDLE  handle,
DWORD  flags,
DEV_BROADCAST_HDR header 
)
static

Definition at line 685 of file input.c.

686{
687 FIXME("Support for service handles is not yet implemented!\n");
688 return 0;
689}

Referenced by RegisterDeviceNotificationW().

◆ devnotify_window_callbackA()

static DWORD CALLBACK devnotify_window_callbackA ( HANDLE  handle,
DWORD  flags,
DEV_BROADCAST_HDR header 
)
static

Definition at line 627 of file input.c.

628{
629 if (flags & 0x8000)
630 {
631 switch (header->dbch_devicetype)
632 {
634 {
636 size_t lenW = wcslen( ifaceW->dbcc_name );
638 DWORD lenA;
639
640 if (!(ifaceA = malloc( offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenW * 3 + 1]) )))
641 return 0;
642 lenA = WideCharToMultiByte( CP_ACP, 0, ifaceW->dbcc_name, lenW + 1,
643 ifaceA->dbcc_name, lenW * 3 + 1, NULL, NULL );
644
645 ifaceA->dbcc_size = offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenA + 1]);
646 ifaceA->dbcc_devicetype = ifaceW->dbcc_devicetype;
647 ifaceA->dbcc_reserved = ifaceW->dbcc_reserved;
648 ifaceA->dbcc_classguid = ifaceW->dbcc_classguid;
650 free( ifaceA );
651 return 0;
652 }
653
655 {
656 const DEV_BROADCAST_HANDLE *handleW = (const DEV_BROADCAST_HANDLE *)header;
657 UINT sizeW = handleW->dbch_size - offsetof(DEV_BROADCAST_HANDLE, dbch_data[0]), len, offset;
658 DEV_BROADCAST_HANDLE *handleA;
659
660 if (!(handleA = malloc( offsetof(DEV_BROADCAST_HANDLE, dbch_data[sizeW * 3 + 1]) ))) return 0;
661 memcpy( handleA, handleW, offsetof(DEV_BROADCAST_HANDLE, dbch_data[0]) );
662 offset = min( sizeW, handleW->dbch_nameoffset );
663
664 memcpy( handleA->dbch_data, handleW->dbch_data, offset );
665 len = WideCharToMultiByte( CP_ACP, 0, (WCHAR *)(handleW->dbch_data + offset), (sizeW - offset) / sizeof(WCHAR),
666 (char *)handleA->dbch_data + offset, sizeW * 3 + 1 - offset, NULL, NULL );
667 handleA->dbch_size = offsetof(DEV_BROADCAST_HANDLE, dbch_data[offset + len + 1]);
668
670 free( handleA );
671 return 0;
672 }
673
674 case DBT_DEVTYP_OEM:
675 break;
676 default:
677 FIXME( "unimplemented W to A mapping for %#lx\n", header->dbch_devicetype );
678 }
679 }
680
682 return 0;
683}
#define DBT_DEVTYP_HANDLE
Definition: dbt.h:25
#define DBT_DEVTYP_DEVICEINTERFACE
Definition: dbt.h:24
#define DBT_DEVTYP_OEM
Definition: dbt.h:19
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
static const WCHAR sizeW[]
Definition: editor.c:79
unsigned long DWORD
Definition: ntddk_ex.h:95
GLintptr offset
Definition: glext.h:5920
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define offsetof(TYPE, MEMBER)
LONG dbch_nameoffset
Definition: dbt.h:128
BYTE dbch_data[1]
Definition: dbt.h:129
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_DEVICECHANGE
Definition: winuser.h:1822
LRESULT WINAPI SendMessageTimeoutA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RegisterDeviceNotificationW().

◆ devnotify_window_callbackW()

static DWORD CALLBACK devnotify_window_callbackW ( HANDLE  handle,
DWORD  flags,
DEV_BROADCAST_HDR header 
)
static

Definition at line 621 of file input.c.

622{
624 return 0;
625}
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)

Referenced by RegisterDeviceNotificationW().

◆ get_locale_kbd_layout()

static HKL get_locale_kbd_layout ( void  )
static

Definition at line 167 of file input.c.

168{
170
171 /* FIXME:
172 *
173 * layout = main_key_tab[kbd_layout].lcid;
174 *
175 * Winword uses return value of GetKeyboardLayout as a codepage
176 * to translate ANSI keyboard messages to unicode. But we have
177 * a problem with it: for instance Polish keyboard layout is
178 * identical to the US one, and therefore instead of the Polish
179 * locale id we return the US one.
180 */
181
184 return (HKL)layout;
185}
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1211
static DWORD layout
Definition: bitmap.c:46
UINT_PTR HKL
Definition: msctf.idl:143
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by LoadKeyboardLayoutW().

◆ GetActiveWindow()

◆ GetCapture()

HWND WINAPI GetCapture ( void  )

◆ GetCursorPos()

BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos ( POINT pt)

Definition at line 228 of file input.c.

229{
230 return NtUserGetCursorPos( pt );
231}
#define pt(x, y)
Definition: drawing.c:79

◆ GetFocus()

HWND WINAPI GetFocus ( void  )

Definition at line 954 of file input.c.

955{
957 info.cbSize = sizeof(info);
958 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0;
959}

Referenced by _CmdWndProc(), _tWinMain(), check_active_state_(), check_wnd_state_(), Client_get_accState(), COMBOEX_ComboWndProc(), FileChildWindow::Command(), CicBridge::CreateInputContext(), CredDialogInit(), DEFDLG_Proc(), DEFDLG_SaveFocus(), delayFocusDlgWinProc(), DialogProc_0(), DialogProc_1(), DlgMainProc(), edit_dialog_proc(), edit_singleline_dialog_proc(), edit_wantreturn_dialog_proc(), EDIT_WM_NCPaint(), EndDialog(), FillGrid(), FormatDriveDlg(), GetActiveContext(), CMainWindow::HandleTabOrder(), CAddressBand::HasFocusIO(), CBrandBand::HasFocusIO(), ImmWINNLSEnableIME(), CAutoComplete::Init(), installer_proc(), IntDrawScrollBar(), IntScrollHandleScrollEvent(), IPADDRESS_Draw(), is_doc_child_focus(), IsDialogMessageW(), IShellBrowserImpl_BrowseObject(), make_new_folder_timer_callback(), MapWndProc(), MsgCheckProcA(), MSIDialog_WndProc(), multi_edit_dialog_proc(), CDefView::OnContextMenu(), OnTimer(), CMainWindow::ProcessWindowMessage(), PROPSHEET_SetWizButtons(), SCROLL_HandleScrollEvent(), set_focus_on_activate_proc(), CicBridge::SetActiveContextAlways(), CAutoComplete::ShowDropDown(), TAB_DrawItemInterior(), test_accelerators(), test_attach_input(), test_autoradio_kbd_move(), test_button_messages(), test_capture_2(), test_combo_editselection_focus(), test_comboex_WM_LBUTTONDOWN(), test_dialog_messages(), test_editbox(), test_editselection_focus(), test_focus(), test_IsDialogMessage(), test_keyboard_input(), test_LVN_ENDLABELEDIT(), test_mdi_messages(), test_messages(), test_SaveRestoreFocus(), test_SetFocus(), test_SetForegroundWindow(), test_wiznavigation(), test_WM_LBUTTONDOWN(), test_WM_NEXTDLGCTL(), thread_proc_0(), thread_proc_1(), thread_proc_2(), ThreadMgr_AssociateFocus(), ThreadMgr_IsThreadFocus(), TreeListKeyDown(), TreeListMouseClick(), TREEVIEW_DrawItem(), TreeWndNotifyProc(), CSearchBar::TrySetFocus(), User32DefWindowProc(), WndProc(), FileChildWindow::WndProc(), and StartMenuButton::WndProc().

◆ GetGestureConfig()

BOOL WINAPI GetGestureConfig ( HWND  hwnd,
DWORD  reserved,
DWORD  flags,
UINT count,
GESTURECONFIG *  config,
UINT  size 
)

Definition at line 895 of file input.c.

897{
898 FIXME( "handle %p, reserved %#lx, flags %#lx, count %p, config %p, size %u stub!\n",
901 return FALSE;
902}
r reserved
Definition: btrfs.c:3006
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ GetGestureExtraArgs()

BOOL WINAPI GetGestureExtraArgs ( HGESTUREINFO  handle,
UINT  count,
BYTE args 
)

Definition at line 875 of file input.c.

876{
877 FIXME( "handle %p, count %u, args %p stub!\n", handle, count, args );
879 return FALSE;
880}
Definition: match.c:390

◆ GetGestureInfo()

BOOL WINAPI GetGestureInfo ( HGESTUREINFO  handle,
GESTUREINFO *  ptr 
)

Definition at line 885 of file input.c.

886{
887 FIXME( "handle %p, ptr %p stub!\n", handle, ptr );
889 return FALSE;
890}
static PVOID ptr
Definition: dispmode.c:27

◆ GetInputState()

BOOL WINAPI GetInputState ( void  )

Definition at line 284 of file input.c.

285{
286 return NtUserGetInputState();
287}

◆ GetKBCodePage()

UINT WINAPI GetKBCodePage ( void  )

Definition at line 456 of file input.c.

457{
458 return GetOEMCP();
459}
UINT WINAPI GetOEMCP(void)
Definition: locale.c:2060

◆ GetKeyboardLayoutNameA()

BOOL WINAPI GetKeyboardLayoutNameA ( LPSTR  pszKLID)

Definition at line 464 of file input.c.

465{
467
469 return WideCharToMultiByte( CP_ACP, 0, buf, -1, pszKLID, KL_NAMELENGTH, NULL, NULL ) != 0;
470 return FALSE;
471}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
BOOL NTAPI NtUserGetKeyboardLayoutName(_Inout_ PUNICODE_STRING pustrName)
Definition: kbdlayout.c:1092
#define KL_NAMELENGTH
Definition: winuser.h:122

◆ GetKeyboardType()

INT WINAPI GetKeyboardType ( INT  nTypeFlag)

Definition at line 379 of file input.c.

380{
381 TRACE_(keyboard)("(%d)\n", nTypeFlag);
383 {
384 /* scan code for `_', the key left of r-shift, in Japanese 106 keyboard */
385 const UINT JP106_VSC_USCORE = 0x73;
386
387 switch(nTypeFlag)
388 {
389 case 0: /* Keyboard type */
390 return 7; /* Japanese keyboard */
391 case 1: /* Keyboard Subtype */
392 /* Test keyboard mappings to detect Japanese keyboard */
393 if (MapVirtualKeyW(VK_OEM_102, MAPVK_VK_TO_VSC) == JP106_VSC_USCORE
394 && MapVirtualKeyW(JP106_VSC_USCORE, MAPVK_VSC_TO_VK) == VK_OEM_102)
395 return 2; /* Japanese 106 */
396 else
397 return 0; /* AT-101 */
398 case 2: /* Number of F-keys */
399 return 12; /* It has 12 F-keys */
400 }
401 }
402 else
403 {
404 switch(nTypeFlag)
405 {
406 case 0: /* Keyboard type */
407 return 4; /* AT-101 */
408 case 1: /* Keyboard Subtype */
409 return 0; /* There are no defined subtypes */
410 case 2: /* Number of F-keys */
411 return 12; /* We're doing an 101 for now, so return 12 F-keys */
412 }
413 }
414 WARN_(keyboard)("Unknown type\n");
415 return 0; /* The book says 0 here, so 0 */
416}
#define TRACE_(x)
Definition: compat.h:76
HKL NTAPI NtUserGetKeyboardLayout(DWORD dwThreadid)
#define LOWORD(l)
Definition: pedump.c:82
#define SUBLANG_JAPANESE_JAPAN
Definition: nls.h:271
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_JAPANESE
Definition: nls.h:76
#define WARN_(ch,...)
Definition: debug.h:157
#define MAPVK_VSC_TO_VK
Definition: winuser.h:2367
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
#define MAPVK_VK_TO_VSC
Definition: winuser.h:2366

◆ GetKeyNameTextA()

INT WINAPI GetKeyNameTextA ( LONG  lParam,
LPSTR  lpBuffer,
INT  nSize 
)

Definition at line 476 of file input.c.

477{
478 WCHAR buf[256];
479 INT ret;
480
482 {
483 lpBuffer[0] = 0;
484 return 0;
485 }
487 if (!ret && nSize)
488 {
489 ret = nSize - 1;
490 lpBuffer[ret] = 0;
491 }
492 else ret--;
493
494 return ret;
495}
LPARAM lParam
Definition: combotst.c:139
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD NTAPI NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int nSize)
Definition: keyboard.c:1584
int32_t INT
Definition: typedefs.h:58
int ret
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2115

◆ GetLastInputInfo()

BOOL WINAPI GetLastInputInfo ( PLASTINPUTINFO  plii)

Definition at line 293 of file input.c.

294{
295 TRACE("%p\n", plii);
296
297 if (plii->cbSize != sizeof (*plii) )
298 {
300 return FALSE;
301 }
302 plii->dwTime = NtUserGetLastInputTime();
303 return TRUE;
304}
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

◆ GetPointerTouchInfo()

BOOL WINAPI GetPointerTouchInfo ( UINT32  id,
POINTER_TOUCH_INFO *  info 
)

Definition at line 916 of file input.c.

917{
918 FIXME( "id %u, info %p stub!\n", id, info );
920 return FALSE;
921}

◆ GetPointerTouchInfoHistory()

BOOL WINAPI GetPointerTouchInfoHistory ( UINT32  id,
UINT32 count,
POINTER_TOUCH_INFO *  info 
)

Definition at line 923 of file input.c.

924{
925 FIXME( "id %u, count %p, info %p stub!\n", id, count, info );
927 return FALSE;
928}

◆ GetProgmanWindow()

HWND WINAPI GetProgmanWindow ( void  )

Definition at line 992 of file input.c.

993{
994 return NtUserGetProgmanWindow();
995}

◆ GetRawInputDeviceInfoA()

UINT WINAPI GetRawInputDeviceInfoA ( HANDLE  device,
UINT  command,
void data,
UINT size 
)

Definition at line 770 of file input.c.

771{
772 TRACE( "device %p, command %#x, data %p, size %p.\n", device, command, data, size );
773
774 /* RIDI_DEVICENAME size is in chars, not bytes */
775 if (command == RIDI_DEVICENAME)
776 {
777 WCHAR *nameW;
778 UINT ret, sizeW;
779
780 if (!size) return ~0U;
781
782 sizeW = *size;
783
784 if (data && sizeW > 0)
785 nameW = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * sizeW );
786 else
787 nameW = NULL;
788
790
791 if (ret && ret != ~0U)
793
794 *size = sizeW;
795
797
798 return ret;
799 }
800
802}
static const WCHAR nameW[]
Definition: main.c:49
#define U(x)
Definition: wordpad.c:45
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD NTAPI NtUserGetRawInputDeviceInfo(HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize)
Definition: ntstubs.c:417
Definition: devices.h:37

◆ GetShellWindow()

◆ GetTaskmanWindow()

HWND WINAPI GetTaskmanWindow ( void  )

Definition at line 1009 of file input.c.

1010{
1011 return NtUserGetTaskmanWindow();
1012}

Referenced by UserpShowInformationBalloon().

◆ GetTouchInputInfo()

BOOL WINAPI GetTouchInputInfo ( HTOUCHINPUT  handle,
UINT  count,
TOUCHINPUT *  ptr,
int  size 
)

Definition at line 828 of file input.c.

829{
830 FIXME( "handle %p, count %u, ptr %p, size %u stub!\n", handle, count, ptr, size );
832 return FALSE;
833}

◆ IsTouchWindow()

BOOL WINAPI IsTouchWindow ( HWND  hwnd,
ULONG flags 
)

Definition at line 838 of file input.c.

839{
840 FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags );
841 return FALSE;
842}

◆ keybd_event()

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

Definition at line 191 of file input.c.

193{
194 INPUT input;
195
196 input.type = INPUT_KEYBOARD;
197 input.ki.wVk = bVk;
198 input.ki.wScan = bScan;
199 input.ki.dwFlags = dwFlags;
200 input.ki.time = 0;
201 input.ki.dwExtraInfo = dwExtraInfo;
202 NtUserSendInput( 1, &input, sizeof(input) );
203}
GLenum GLenum GLenum input
Definition: glext.h:9031
UINT NTAPI NtUserSendInput(UINT nInputs, LPINPUT pInput, INT cbSize)
Definition: input.c:708
#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  pwszKLID,
UINT  Flags 
)

Definition at line 585 of file input.c.

586{
587 HKL ret;
588 UNICODE_STRING pwszKLIDW;
589
590 if (pwszKLID) RtlCreateUnicodeStringFromAsciiz(&pwszKLIDW, pwszKLID);
591 else pwszKLIDW.Buffer = NULL;
592
593 ret = LoadKeyboardLayoutW(pwszKLIDW.Buffer, Flags);
594 RtlFreeUnicodeString(&pwszKLIDW);
595 return ret;
596}
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags)
Definition: input.c:822
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ LoadKeyboardLayoutEx()

HKL WINAPI LoadKeyboardLayoutEx ( HKL  layout,
const WCHAR name,
UINT  flags 
)

Definition at line 602 of file input.c.

603{
604 FIXME_(keyboard)( "layout %p, name %s, flags %x, semi-stub!\n", layout, debugstr_w( name ), flags );
605
606 if (!layout) return NULL;
607 return LoadKeyboardLayoutW( name, flags );
608}
#define debugstr_w
Definition: kernel32.h:32
Definition: name.c:39

◆ LoadKeyboardLayoutW()

HKL WINAPI LoadKeyboardLayoutW ( const WCHAR name,
UINT  flags 
)

Definition at line 546 of file input.c.

547{
548 WCHAR layout_path[MAX_PATH], value[5];
550 DWORD id, value_size, tmp;
551 HKEY hkey;
552 HKL layout;
553
554 FIXME_(keyboard)( "name %s, flags %x, semi-stub!\n", debugstr_w( name ), flags );
555
556 tmp = wcstoul( name, NULL, 16 );
557 if (HIWORD( tmp )) layout = UlongToHandle( tmp );
558 else layout = UlongToHandle( MAKELONG( LOWORD( tmp ), LOWORD( tmp ) ) );
559
560 if (!((UINT_PTR)layout >> 28)) id = LOWORD( tmp );
561 else id = HIWORD( layout ); /* IME or aliased layout */
562
563 wcscpy( layout_path, L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\" );
564 wcscat( layout_path, name );
565
566 if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, layout_path, &hkey ))
567 {
568 value_size = sizeof(value);
569 if (!RegGetValueW( hkey, NULL, L"Layout Id", RRF_RT_REG_SZ, NULL, (void *)&value, &value_size ))
570 id = 0xf000 | (wcstoul( value, NULL, 16 ) & 0xfff);
571
572 RegCloseKey( hkey );
573 }
574
577
578 /* FIXME: semi-stub: returning default layout */
579 return get_locale_kbd_layout();
580}
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define RegCloseKey(hKey)
Definition: registry.h:49
Definition: _locale.h:75
wcscat
wcscpy
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
#define MAX_PATH
Definition: compat.h:34
#define RRF_RT_REG_SZ
Definition: driver.c:575
GLuint id
Definition: glext.h:5910
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
HKL NTAPI NtUserActivateKeyboardLayout(HKL hKL, ULONG Flags)
Definition: kbdlayout.c:1226
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define L(x)
Definition: ntvdm.h:50
DWORD LCID
Definition: nls.h:13
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:96
static HKL get_locale_kbd_layout(void)
Definition: input.c:167
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KLF_ACTIVATE
Definition: winuser.h:111

◆ MapVirtualKeyA()

UINT WINAPI MapVirtualKeyA ( UINT  code,
UINT  maptype 
)

Definition at line 421 of file input.c.

422{
423 return MapVirtualKeyExA( code, maptype, NtUserGetKeyboardLayout(0) );
424}
Definition: inflate.c:139
UINT WINAPI MapVirtualKeyExA(_In_ UINT, _In_ UINT, _In_opt_ HKL)

◆ MapVirtualKeyExA()

UINT WINAPI MapVirtualKeyExA ( UINT  code,
UINT  maptype,
HKL  hkl 
)

Definition at line 437 of file input.c.

438{
439 UINT ret;
440
441 ret = NtUserMapVirtualKeyEx( code, maptype, hkl );
442 if (maptype == MAPVK_VK_TO_CHAR)
443 {
444 BYTE ch = 0;
445 WCHAR wch = ret;
446
447 WideCharToMultiByte( CP_ACP, 0, &wch, 1, (LPSTR)&ch, 1, NULL, NULL );
448 ret = ch;
449 }
450 return ret;
451}
UINT NTAPI NtUserMapVirtualKeyEx(UINT keyCode, UINT transType, DWORD keyboardId, HKL dwhkl)
Definition: keyboard.c:1439
HKL hkl
Definition: msctf.idl:650
#define MAPVK_VK_TO_CHAR
Definition: winuser.h:2368
char * LPSTR
Definition: xmlstorage.h:182
unsigned char BYTE
Definition: xxhash.c:193

◆ MapVirtualKeyW()

UINT WINAPI MapVirtualKeyW ( UINT  code,
UINT  maptype 
)

Definition at line 429 of file input.c.

430{
432}

◆ mouse_event()

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

Definition at line 209 of file input.c.

211{
212 INPUT input;
213
214 input.type = INPUT_MOUSE;
215 input.mi.dx = dx;
216 input.mi.dy = dy;
217 input.mi.mouseData = dwData;
218 input.mi.dwFlags = dwFlags;
219 input.mi.time = 0;
220 input.mi.dwExtraInfo = dwExtraInfo;
221 NtUserSendInput( 1, &input, sizeof(input) );
222}
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define INPUT_MOUSE
Definition: winable.h:9

◆ OemKeyScan()

DWORD WINAPI OemKeyScan ( WORD  oem)

Definition at line 358 of file input.c.

359{
360 WCHAR wchr;
361 DWORD vkey, scan;
362 char oem_char = LOBYTE( oem );
363
364 if (!OemToCharBuffW( &oem_char, &wchr, 1 ))
365 return -1;
366
367 vkey = VkKeyScanW( wchr );
368 scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
369 if (!scan) return -1;
370
371 vkey &= 0xff00;
372 vkey <<= 8;
373 return vkey | scan;
374}
#define LOBYTE(W)
Definition: jmemdos.c:487
BOOL WINAPI OemToCharBuffW(_In_ LPCSTR lpszSrc, _Out_writes_(cchDstLength) LPWSTR lpszDst, _In_ DWORD cchDstLength)
SHORT WINAPI VkKeyScanW(_In_ WCHAR)

◆ RegisterDeviceNotificationA()

HDEVNOTIFY WINAPI RegisterDeviceNotificationA ( HANDLE  handle,
void filter,
DWORD  flags 
)

Definition at line 696 of file input.c.

697{
699}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE handle, void *filter, DWORD flags)
Definition: input.c:704

◆ RegisterDeviceNotificationW()

HDEVNOTIFY WINAPI RegisterDeviceNotificationW ( HANDLE  handle,
void filter,
DWORD  flags 
)

Definition at line 704 of file input.c.

705{
707 device_notify_callback callback;
708
709 TRACE("handle %p, filter %p, flags %#lx\n", handle, filter, flags);
710
711 if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES))
712 {
714 return NULL;
715 }
716
717 if (!(flags & DEVICE_NOTIFY_SERVICE_HANDLE) && !IsWindow( handle ))
718 {
720 return NULL;
721 }
722
723 if (flags & DEVICE_NOTIFY_SERVICE_HANDLE)
725 else if (IsWindowUnicode( handle ))
727 else
729
730 if (!header)
731 {
733 return I_ScRegisterDeviceNotification( handle, &dummy, callback );
734 }
735 if (header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
736 {
738
739 if (flags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
740 iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_classguid );
741 else
743
744 return I_ScRegisterDeviceNotification( handle, (DEV_BROADCAST_HDR *)&iface, callback );
745 }
746 if (header->dbch_devicetype == DBT_DEVTYP_HANDLE)
747 {
748 FIXME( "DBT_DEVTYP_HANDLE not implemented\n" );
749 return I_ScRegisterDeviceNotification( handle, header, callback );
750 }
751
752 FIXME( "type %#lx not implemented\n", header->dbch_devicetype );
754 return NULL;
755}
static IPrintDialogCallback callback
Definition: printdlg.c:326
static DWORD CALLBACK devnotify_service_callback(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
Definition: input.c:685
static DWORD CALLBACK devnotify_window_callbackW(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
Definition: input.c:621
static DWORD CALLBACK devnotify_window_callbackA(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
Definition: input.c:627
#define ERROR_INVALID_DATA
Definition: winerror.h:116
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI IsWindowUnicode(_In_ HWND)

Referenced by RegisterDeviceNotificationA().

◆ RegisterTouchWindow()

BOOL WINAPI RegisterTouchWindow ( HWND  hwnd,
ULONG  flags 
)

Definition at line 847 of file input.c.

848{
849 FIXME( "hwnd %p, flags %#lx stub!\n", hwnd, flags );
850 return TRUE;
851}

◆ ReleaseCapture()

BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture ( void  )

Definition at line 237 of file input.c.

238{
239 return NtUserReleaseCapture();
240}

Referenced by BrFolder_Expand(), BUTTON_WindowProc(), ButtonWndProc_common(), C1_OnButtonUp(), CBRollUp(), CC_WMLButtonUp(), CC_WMMouseMove(), CheckListWndProc(), ChildWndProc(), COMBO_LButtonDown(), COMBO_LButtonUp(), COMBO_MouseMove(), COMBOEX_ComboWndProc(), DoAppSwitch(), DoTest_BUTTON(), DoTest_EDIT(), drag_end(), DragDetect(), DragList_EndDrag(), EDIT_WM_LButtonUp(), finish_splitbar(), GROUP_GroupWndProc(), HEADER_LButtonUp(), HEXEDIT_WM_LBUTTONUP(), IntScrollHandleScrollEvent(), ITextHostImpl_TxSetCapture(), LISTBOX_HandleLButtonDownCombo(), LISTBOX_HandleLButtonUp(), LISTVIEW_KillFocus(), LISTVIEW_LButtonDown(), LISTVIEW_LButtonUp(), LISTVIEW_TrackMouse(), MainProc(), MonSelCancelDragging(), MONTHCAL_LButtonUp(), MsgCheckProc(), MyWndProc(), CCanvasWindow::OnButtonDblClk(), CCanvasWindow::OnButtonUp(), CCanvasWindow::OnKeyDown(), CardButton::OnLButtonUp(), Window::OnLButtonUp(), CardRegion::OnLButtonUp(), CPaletteWindow::OnLButtonUp(), CToolBox::OnLButtonUp(), CTrayShowDesktopButton::OnLButtonUp(), CBaseBar::OnLButtonUp(), CInternetToolbar::OnLUp(), OnMouse(), OwnerDrawButtonSubclass(), PAGER_MouseMove(), CUiSplitPanel::ProcessWindowMessage(), REBAR_LButtonUp(), REBAR_MouseMove(), SB_OnLButtonUp(), SCROLL_HandleScrollEvent(), SCROLL_TrackScrollBar(), ScrollTrackScrollBar(), CMenuFocusManager::SetMenuCapture(), T1_OnButtonUp(), test_button_messages(), test_capture_3(), test_capture_4_proc(), test_edit_messages(), test_Input_mouse(), ThemeHandleButton(), TOOLBAR_LButtonUp(), TRACKBAR_LButtonUp(), TREEVIEW_TrackMouse(), UPDOWN_CancelMode(), WndProc(), SDIMainFrame::WndProc(), StartButton::WndProc(), StartMenu::WndProc(), ChildWindow::WndProc(), FlatButton::WndProc(), and ZoomWnd_OnButtonUp().

◆ SetCaretBlinkTime()

BOOL WINAPI SetCaretBlinkTime ( unsigned int  time)

Definition at line 275 of file input.c.

276{
277 return NtUserSetCaretBlinkTime( time );
278}
__u16 time
Definition: mkdosfs.c:8

◆ SetCaretPos()

BOOL WINAPI SetCaretPos ( int  x,
int  y 
)

Definition at line 266 of file input.c.

267{
268 return NtUserSetCaretPos( x, y );
269}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ SetForegroundWindow()

BOOL WINAPI SetForegroundWindow ( HWND  hwnd)

Definition at line 934 of file input.c.

935{
936 return NtUserSetForegroundWindow( hwnd );
937}

◆ SetGestureConfig()

BOOL WINAPI SetGestureConfig ( HWND  hwnd,
DWORD  reserved,
UINT  count,
GESTURECONFIG *  config,
UINT  size 
)

Definition at line 907 of file input.c.

909{
910 FIXME( "handle %p, reserved %#lx, count %u, config %p, size %u stub!\n",
913 return FALSE;
914}

◆ SetProgmanWindow()

HWND WINAPI SetProgmanWindow ( HWND  hwnd)

Definition at line 983 of file input.c.

984{
985 return NtUserSetProgmanWindow( hwnd );
986}

◆ SetShellWindow()

BOOL WINAPI SetShellWindow ( HWND  hwnd)

Definition at line 965 of file input.c.

966{
968}
BOOL NTAPI NtUserSetShellWindowEx(HWND hwndShell, HWND hwndShellListView)
Definition: window.c:3717

Referenced by DesktopWindow::Init(), IsAnyDesktopRunning(), test_shell_window(), and DesktopWindow::WndProc().

◆ SetTaskmanWindow()

HWND WINAPI SetTaskmanWindow ( HWND  hwnd)

Definition at line 1001 of file input.c.

1002{
1003 return NtUserSetTaskmanWindow( hwnd );
1004}

Referenced by RegisterShellHook().

◆ ToAscii()

INT WINAPI ToAscii ( UINT  virtKey,
UINT  scanCode,
const BYTE lpKeyState,
LPWORD  lpChar,
UINT  flags 
)

Definition at line 508 of file input.c.

510{
511 return ToAsciiEx( virtKey, scanCode, lpKeyState, lpChar, flags,
513}
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  virtKey,
UINT  scanCode,
const BYTE lpKeyState,
LPWORD  lpChar,
UINT  flags,
HKL  dwhkl 
)

Definition at line 518 of file input.c.

520{
521 WCHAR uni_chars[2];
522 INT ret, n_ret;
523
524 ret = NtUserToUnicodeEx( virtKey, scanCode, lpKeyState, uni_chars, 2, flags, dwhkl );
525 if (ret < 0) n_ret = 1; /* FIXME: make ToUnicode return 2 for dead chars */
526 else n_ret = ret;
527 WideCharToMultiByte(CP_ACP, 0, uni_chars, n_ret, (LPSTR)lpChar, 2, NULL, NULL);
528 return ret;
529}
INT NTAPI NtUserToUnicodeEx(UINT wVirtKey, UINT wScanCode, PBYTE lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)

◆ ToUnicode()

INT WINAPI ToUnicode ( UINT  virt,
UINT  scan,
const BYTE state,
LPWSTR  str,
int  size,
UINT  flags 
)

Definition at line 500 of file input.c.

501{
502 return NtUserToUnicodeEx( virt, scan, state, str, size, flags, NtUserGetKeyboardLayout(0) );
503}
static int state
Definition: maze.c:121
const WCHAR * str

◆ UnloadKeyboardLayout()

BOOL WINAPI UnloadKeyboardLayout ( HKL  layout)

Definition at line 613 of file input.c.

614{
615 FIXME_(keyboard)( "layout %p, stub!\n", layout );
617 return FALSE;
618}

◆ UnregisterDeviceNotification()

BOOL WINAPI UnregisterDeviceNotification ( HDEVNOTIFY  handle)

Definition at line 760 of file input.c.

761{
762 TRACE("%p\n", handle);
763
764 return I_ScUnregisterDeviceNotification( handle );
765}

◆ UnregisterTouchWindow()

BOOL WINAPI UnregisterTouchWindow ( HWND  hwnd)

Definition at line 856 of file input.c.

857{
858 FIXME( "hwnd %p stub!\n", hwnd );
859 return TRUE;
860}

◆ VkKeyScanA()

SHORT WINAPI VkKeyScanA ( CHAR  cChar)

Definition at line 324 of file input.c.

325{
326 WCHAR wChar;
327
328 if (IsDBCSLeadByte(cChar)) return -1;
329
330 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
331 return VkKeyScanW(wChar);
332}
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
Definition: locale.c:2124

◆ VkKeyScanExA()

WORD WINAPI VkKeyScanExA ( CHAR  cChar,
HKL  dwhkl 
)

Definition at line 345 of file input.c.

346{
347 WCHAR wChar;
348
349 if (IsDBCSLeadByte(cChar)) return -1;
350
351 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
352 return NtUserVkKeyScanEx( wChar, dwhkl );
353}
DWORD NTAPI NtUserVkKeyScanEx(WCHAR wChar, HKL KeyboardLayout, BOOL bUsehHK)
Definition: keyboard.c:1709

◆ VkKeyScanW()

SHORT WINAPI VkKeyScanW ( WCHAR  cChar)

Definition at line 337 of file input.c.

338{
339 return NtUserVkKeyScanEx( cChar, NtUserGetKeyboardLayout(0) );
340}

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( keyboard  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( win  )