SharpDX.RawInput Provides access to RawInput methods. Gets the devices. Registers the devices that supply the raw input data. The usage page. The usage id. The flags. Registers the devices that supply the raw input data. The usage page. The usage id. The flags. The target. if set to true register message filter to Application.AddMessageFilter. Handles a RawInput message manually. A pointer to a RawInput message. This method can be used directly when handling RawInput messages from non-WinForms application. Occurs when [keyboard input]. Occurs when [mouse input]. Occurs when [raw input]. Internal RawInput message filtering WM_INPUT Defines the raw input data coming from any device. RID_DEVICE_INFO Initializes a new instance of the class. Initializes a new instance of the class. The raw device info. Name of the device. The device handle. Converts the specified raw device info to the . The raw device info. Name of the device. The device handle. Gets or sets the name of the device. The name of the device. Gets or sets the type of the device. The type of the device. Gets or sets the handle. The handle. No documentation. RAW_DEVICE_FLAGS No documentation. RIDEV_REMOVE No documentation. RIDEV_EXCLUDE No documentation. RIDEV_PAGEONLY No documentation. RIDEV_NOLEGACY No documentation. RIDEV_INPUTSINK No documentation. RIDEV_CAPTUREMOUSE No documentation. RIDEV_NOHOTKEYS No documentation. RIDEV_APPKEYS No documentation. RIDEV_EXINPUTSINK No documentation. RIDEV_DEVNOTIFY None. None No documentation. RAW_DEVICE_TYPE No documentation. RIM_TYPEMOUSE No documentation. RIM_TYPEKEYBOARD No documentation. RIM_TYPEHID No documentation. RAW_KEY_STATE No documentation. WM_VKEYTOITEM No documentation. WM_SETHOTKEY No documentation. WM_GETHOTKEY No documentation. WM_KEYFIRST No documentation. WM_KEYDOWN No documentation. WM_KEYUP No documentation. WM_SYSKEYDOWN No documentation. WM_SYSKEYUP No documentation. WM_KEYLAST No documentation. WM_IME_KEYLAST No documentation. WM_IME_KEYDOWN No documentation. WM_IME_KEYUP No documentation. WM_HOTKEY No documentation. RAW_MOUSE_BUTTON_FLAGS No documentation. RI_MOUSE_LEFT_BUTTON_DOWN No documentation. RI_MOUSE_LEFT_BUTTON_UP No documentation. RI_MOUSE_RIGHT_BUTTON_DOWN No documentation. RI_MOUSE_RIGHT_BUTTON_UP No documentation. RI_MOUSE_MIDDLE_BUTTON_DOWN No documentation. RI_MOUSE_MIDDLE_BUTTON_UP No documentation. RI_MOUSE_BUTTON_1_DOWN No documentation. RI_MOUSE_BUTTON_1_UP No documentation. RI_MOUSE_BUTTON_2_DOWN No documentation. RI_MOUSE_BUTTON_2_UP No documentation. RI_MOUSE_BUTTON_3_DOWN No documentation. RI_MOUSE_BUTTON_3_UP No documentation. RI_MOUSE_BUTTON_4_DOWN No documentation. RI_MOUSE_BUTTON_4_UP No documentation. RI_MOUSE_BUTTON_5_DOWN No documentation. RI_MOUSE_BUTTON_5_UP No documentation. RI_MOUSE_WHEEL None. None No documentation. RAW_MOUSE_MODE No documentation. MOUSE_MOVE_RELATIVE No documentation. MOUSE_MOVE_ABSOLUTE No documentation. MOUSE_VIRTUAL_DESKTOP No documentation. MOUSE_ATTRIBUTES_CHANGED No documentation. MOUSE_MOVE_NOCOALESCE No documentation. RAW_INPUT_DATA_TYPE No documentation. RID_INPUT No documentation. RID_HEADER No documentation. RAW_INPUT_DEVICE_INFO_TYPE No documentation. RIDI_PREPARSEDDATA No documentation. RIDI_DEVICENAME No documentation. RIDI_DEVICEINFO No documentation. RAW_SCAN_CODE_FLAGS No documentation. RI_KEY_MAKE No documentation. RI_KEY_BREAK No documentation. RI_KEY_E0 No documentation. RI_KEY_E1 Functions Enumerates the raw input devices attached to the system. An array of structures for the devices attached to the system. If null, the number of devices are returned in *puiNumDevices. If pRawInputDeviceList is null, the function populates this variable with the number of devices attached to the system; otherwise, this variable specifies the number of structures that can be contained in the buffer to which pRawInputDeviceList points. If this value is less than the number of devices attached to the system, the function returns the actual number of devices in this variable and fails with . The size of a structure, in bytes. If the function is successful, the return value is the number of devices stored in the buffer pointed to by pRawInputDeviceList.On any other error, the function returns (UINT) -1 and GetLastError returns the error indication. The devices returned from this function are the mouse, the keyboard, and other Human Interface Device (HID) devices.To get more detailed information about the attached devices, call GetRawInputDeviceInfo using the hDevice from . unsigned int GetRawInputDeviceList([Out, Buffer, Optional] RAWINPUTDEVICELIST* pRawInputDeviceList,[InOut] unsigned int* puiNumDevices,[In] unsigned int cbSize) Registers the devices that supply the raw input data. An array of structures that represent the devices that supply the raw input. The number of structures pointed to by pRawInputDevices. The size, in bytes, of a structure. TRUE if the function succeeds; otherwise, . If the function fails, call GetLastError for more information. To receive WM_INPUT messages, an application must first register the raw input devices using RegisterRawInputDevices. By default, an application does not receive raw input.To receive WM_INPUT_DEVICE_CHANGE messages, an application must specify the flag for each device class that is specified by the usUsagePage and usUsage fields of the structure . By default, an application does not receive WM_INPUT_DEVICE_CHANGE notifications for raw input device arrival and removal.If a structure has the flag set and the hwndTarget parameter is not set to null, then parameter validation will fail. BOOL RegisterRawInputDevices([In, Buffer] const RAWINPUTDEVICE* pRawInputDevices,[In] unsigned int uiNumDevices,[In] unsigned int cbSize) Performs a buffered read of the raw input data. A reference to a buffer of structures that contain the raw input data. If null, the minimum required buffer, in bytes, is returned in *pcbSize. The size, in bytes, of a structure. The size, in bytes, of the structure. If pData is null and the function is successful, the return value is zero. If pData is not null and the function is successful, the return value is the number of structures written to pData.If an error occurs, the return value is (UINT)-1. Call GetLastError for the error code. Using GetRawInputBuffer, the raw input data is buffered in the array of structures. For an unbuffered read, use the GetMessage function to read in the raw input data.The NEXTRAWINPUTBLOCK macro allows an application to traverse an array of structures.Note??To get the correct size of the raw input buffer, do not use *pcbSize, use *pcbSize * 8 instead. To ensure GetRawInputBuffer behaves properly on WOW64, you must align the structure by 8 bytes. The following code shows how to align for WOW64. [StructLayout(LayoutKind.Explicit)] internal struct { [FieldOffset(0)] public header; [FieldOffset(16+8)] public mouse; [FieldOffset(16+8)] public keyboard; [FieldOffset(16+8)] public hid; } unsigned int GetRawInputBuffer([Out, Buffer, Optional] RAWINPUT* pData,[InOut] unsigned int* pcbSize,[In] unsigned int cbSizeHeader) Retrieves the information about the raw input devices for the current application. An array of structures for the application. The number of structures in *pRawInputDevices. The size, in bytes, of a structure. If successful, the function returns a non-negative number that is the number of structures written to the buffer.If the pRawInputDevices buffer is too small or null, the function sets the last error as , returns -1, and sets puiNumDevices to the required number of devices. If the function fails for any other reason, it returns -1. For more details, call GetLastError. To receive raw input from a device, an application must register it by using RegisterRawInputDevices. unsigned int GetRegisteredRawInputDevices([Out, Buffer, Optional] RAWINPUTDEVICE* pRawInputDevices,[InOut] unsigned int* puiNumDevices,[In] unsigned int cbSize) Defines the raw input data coming from any device. RID_DEVICE_INFO The size, in bytes, of the structure. unsigned int cbSize If dwType is , this is the structure that defines the mouse. RID_DEVICE_INFO_MOUSE mouse If dwType is , this is the structure that defines the keyboard. RID_DEVICE_INFO_KEYBOARD keyboard If dwType is , this is the structure that defines the HID device. RID_DEVICE_INFO_HID hid Defines the raw input data coming from the specified Human Interface Device (HID). RID_DEVICE_INFO_HID The vendor identifier for the HID. unsigned int dwVendorId The product identifier for the HID. unsigned int dwProductId The version number for the HID. unsigned int dwVersionNumber The top-level collection Usage Page for the device. HID_USAGE_PAGE usUsagePage The top-level collection Usage for the device. HID_USAGE_ID usUsage Defines the raw input data coming from the specified keyboard. For the keyboard, the Usage Page is 1 and the Usage is 6. RID_DEVICE_INFO_KEYBOARD The type of the keyboard. unsigned int dwType The subtype of the keyboard. unsigned int dwSubType The scan code mode. unsigned int dwKeyboardMode The number of function keys on the keyboard. unsigned int dwNumberOfFunctionKeys The number of LED indicators on the keyboard. unsigned int dwNumberOfIndicators The total number of keys on the keyboard. unsigned int dwNumberOfKeysTotal Defines the raw input data coming from the specified mouse. For the mouse, the Usage Page is 1 and the Usage is 2. RID_DEVICE_INFO_MOUSE The identifier of the mouse device. unsigned int dwId The number of buttons for the mouse. unsigned int dwNumberOfButtons The number of data points per second. This information may not be applicable for every mouse device. unsigned int dwSampleRate TRUE if the mouse has a wheel for horizontal scrolling; otherwise, . Windows?XP:??This member is only supported starting with Windows?Vista. BOOL fHasHorizontalWheel Describes the format of the raw input from a Human Interface Device (HID). Each WM_INPUT can indicate several inputs, but all of the inputs come from the same HID. The size of the bRawData array is dwSizeHid * dwCount. RAWHID The size, in bytes, of each HID input in bRawData. unsigned int dwSizeHid The number of HID inputs in bRawData. unsigned int dwCount The raw input data, as an array of bytes. int bRawData Contains the raw input from a device. The handle to this structure is passed in the lParam parameter of WM_INPUT.To get detailed information -- such as the header and the content of the raw input -- call GetRawInputData.To read the in the message loop as a buffered read, call GetRawInputBuffer.To get device specific information, call GetRawInputDeviceInfo with the hDevice from .Raw input is available only when the application calls RegisterRawInputDevices with valid device specifications. RAWINPUT The raw input data. RAWINPUTHEADER header Defines information for the raw input devices. If is set for a mouse or a keyboard, the system does not generate any legacy message for that device for the application. For example, if the mouse TLC is set with , WM_LBUTTONDOWN and related legacy mouse messages are not generated. Likewise, if the keyboard TLC is set with , and related legacy keyboard messages are not generated.If is set and the hwndTarget member is not set to null, then parameter validation will fail. RAWINPUTDEVICE Top level collection Usage page for the raw input device. unsigned short usUsagePage Top level collection Usage for the raw input device. unsigned short usUsage A handle to the target window. If null it follows the keyboard focus. HWND hwndTarget Contains information about a raw input device. RAWINPUTDEVICELIST A handle to the raw input device. void* hDevice Contains the header information that is part of the raw input data. To get more information on the device, use hDevice in a call to GetRawInputDeviceInfo. RAWINPUTHEADER The size, in bytes, of the entire input packet of data. This includes plus possible extra input reports in the variable length array. unsigned int dwSize A handle to the device generating the raw input data. void* hDevice The value passed in the wParam parameter of the WM_INPUT message. UINT_PTR wParam No documentation. RAWINPUT_INNER_0 No documentation. RAWMOUSE mouse No documentation. RAWKEYBOARD keyboard No documentation. RAWHID hid Contains information about the state of the keyboard. RAWKEYBOARD The scan code from the key depression. The scan code for keyboard overrun is KEYBOARD_OVERRUN_MAKE_CODE. unsigned short MakeCode Reserved; must be zero. unsigned short Reserved Windows message compatible virtual-key code. For more information, see Virtual Key Codes. unsigned short VKey The corresponding window message, for example , , and so forth. RAW_KEY_STATE Message The device-specific additional information for the event. unsigned int ExtraInformation Defines the raw input data coming from the specified Human Interface Device (HID). Initializes a new instance of the class. Initializes a new instance of the class. The raw device info. Name of the device. The device handle. Gets or sets the vendor id. The vendor id. unsigned int dwVendorId Gets or sets the product id. The product id. unsigned int dwProductId Gets or sets the version number. The version number. unsigned int dwVersionNumber Gets or sets the usage page. The usage page. HID_USAGE_PAGE usUsagePage Gets or sets the usage. The usage. HID_USAGE_ID usUsage Describes the format of the raw input from a Human Interface Device (HID). RawInput event arguments base. Gets or sets the RawInput device. The device. Initializes a new instance of the class. Initializes a new instance of the class. The raw input. Gets or sets the number of Hid structure in the . The count. Gets or sets the size of the Hid structure in the . The size of the data. Gets or sets the raw data. The raw data. Defines the raw input data coming from the specified keyboard. RID_DEVICE_INFO_KEYBOARD Initializes a new instance of the class. Initializes a new instance of the class. The raw device info. Name of the device. The device handle. Gets or sets the type of the keyboard. The type of the keyboard. unsigned int dwType Gets or sets the subtype. The subtype. unsigned int dwSubType Gets or sets the keyboard mode. The keyboard mode. unsigned int dwKeyboardMode Gets or sets the function key count. The function key count. unsigned int dwNumberOfFunctionKeys Gets or sets the indicator count. The indicator count. unsigned int dwNumberOfIndicators Gets or sets the total key count. The total key count. unsigned int dwNumberOfKeysTotal RawInput Keyboard event. Initializes a new instance of the class. Initializes a new instance of the class. The raw input. Gets or sets the key. The key. Gets or sets the make code. The make code. Gets or sets the scan code flags. The scan code flags. Gets or sets the state. The state. Gets or sets the extra information. The extra information. Defines the raw input data coming from the specified mouse. RID_DEVICE_INFO_MOUSE Initializes a new instance of the class. Initializes a new instance of the class. The raw device info. Name of the device. The device handle. Gets or sets the id. The id. unsigned int dwId Gets or sets the button count. The button count. unsigned int dwNumberOfButtons Gets or sets the sample rate. The sample rate. unsigned int dwSampleRate Gets or sets a value indicating whether this instance has horizontal wheel. true if this instance has horizontal wheel; otherwise, false. BOOL fHasHorizontalWheel RawInput Mouse event. Initializes a new instance of the class. Initializes a new instance of the class. The raw input. Gets or sets the mode. The mode. Gets or sets the button flags. The button flags. Gets or sets the extra information. The extra information. Gets or sets the raw buttons. The raw buttons. Gets or sets the wheel delta. The wheel delta. Gets or sets the X. The X. Gets or sets the Y. The Y. Contains information about the state of the mouse. The mouse state. Raw button data. The motion in the X direction. This is signed relative motion or absolute motion, depending on the value of usFlags. The motion in the Y direction. This is signed relative motion or absolute motion, depending on the value of usFlags. The device-specific additional information for the event. Flags for the event. If the mouse wheel is moved, this will contain the delta amount.