Desktop Functions: Smart Device Functions:
|
Search Results for "RAWINPUT" in [All]Structures1: RAWINPUT
public struct RAWINPUTDEVICE
public RawInputDeviceFlags Flags;
Public Structure RAWINPUTDEVICE
Public Flags As RawInputDeviceFlags HIDUsagePage, HIDUsage, RawInputDeviceFlags
public struct RAWINPUTHEADER
public RawInputType Type;
Public Structure RawInputHeader
Public Type As RawInputType 4: RAWINPUTHID
Enums7: HIDUsage
8: HIDUsagePage
QS_RAWINPUT = &H400
QS_RAWINPUT = 0x0400,
QS_INPUT = QS_MOUSE | QS_KEY | QS_RAWINPUT,
QS_RAWINPUT = &H400 11: RawInputCommand
13: RawInputType
14: RawKeyboardFlags
15: RawMouseButtons
16: RawMouseFlags
user3217: GetQueueStatus
QS_RAWINPUT = 0x0400,
QS_INPUT = (QS_MOUSE | QS_KEY | QS_RAWINPUT), 18: GetRawInputData
/// <param name="hRawInput">Handle to the raw input.</param>
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RAWINPUT pData, ref int pcbSize, int cbSizeHeader);
/// <param name="hRawInput">Handle to the raw input.</param>
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, byte[] pData, ref int pcbSize, int cbSizeHeader);
Declare Function GetRawInputData Lib "user32.dll" (TODO) As TODO RAWINPUT is incompatible with x64. See RAWINPUTHEADER.Device and RAWINPUTHEADER.wParam.
if (m.Msg == (int)WindowMessages.RawInput) // WindowMessages.RawInput = 0x00FF (WM_INPUT)
RAWINPUT input = new RAWINPUT();
int size = Marshal.SizeOf(typeof(RAWINPUT));
outSize = Win32API.GetRawInputData(m.LParam, RawInputCommand.Input, out input, ref size, Marshal.SizeOf(typeof(RAWINPUTHEADER)));
if (input.Header.Type == RawInputType.Mouse)
public static extern uint GetRawInputDeviceInfo(int deviceHandle, uint command, ref DeviceInfo data, ref uint dataSize);
Declare Function GetRawInputDeviceInfo Lib "user32.dll" (TODO) As TODO
User32.GetRawInputDeviceInfo(device.hDevice, User32.RIDI_DEVICEINFO, ref di, ref size);
static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, IntPtr pData, ref uint pcbSize);
Declare Function GetRawInputDeviceInfo Lib "user32.dll" Alias "GetRawInputDeviceInfoW" (ByVal hDevice As IntPtr, ByVal uiCommand As DeviceInfoTypes, ByVal pData As IntPtr, ByRef pcbSize As UInteger) As Integer
public enum RawInputDeviceType : uint
public struct RAWINPUTDEVICELIST
public RawInputDeviceType Type;
public static extern uint GetRawInputDeviceList
[In, Out] RAWINPUTDEVICELIST[] RawInputDeviceList,
uint Size /* = (uint)Marshal.SizeOf(typeof(RawInputDeviceList)) */
Public Structure RAWINPUTDEVICELIST
EntryPOint:="GetRawInputDeviceList", SetLastError:=True)> _
Public Function GetRawInputDeviceList(ByVal pRawInputDeviceList As
Declare Function GetRawInputDeviceList Lib "user32.dll" (ByVal pRawInputDeviceList As
int structSize = Marshal.SizeOf(typeof(RAWINPUTDEVICELIST));
int deviceCount = GetRawInputDeviceList(buffer, ref bufferCount, structSize);
RAWINPUTDEVICELIST device = (RAWINPUTDEVICELIST)Marshal.PtrToStructure(
new IntPtr((buffer.ToInt32() + (structSize * i))),typeof(RAWINPUTDEVICELIST));
public static RAWINPUTDEVICELIST[] GetAllRawDevices()
uint dwSize = (uint)Marshal.SizeOf(typeof(RAWINPUTDEVICELIST));
uint retValue = Win32API.GetRawInputDeviceList(null, ref deviceCount, dwSize);
RAWINPUTDEVICELIST[] deviceList = new RAWINPUTDEVICELIST[deviceCount];
retValue = Win32API.GetRawInputDeviceList(deviceList, ref deviceCount, dwSize);
//IntPtr pRawInputDeviceList = Marshal.AllocHGlobal((int)(dwSize * deviceCount));
//Marshal.FreeHGlobal(pRawInputDeviceList);
/// <param name="pRawInputDevices">Array of raw input devices.</param>
/// <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param>
public static extern bool RegisterRawInputDevices([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] RAWINPUTDEVICE[] pRawInputDevices, int uiNumDevices, int cbSize);
''' <param name="pRawInputDevices">Array of raw input devices.</param>
''' <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param>
Public Shared Function RegisterRawInputDevices(<MarshalAs(UnmanagedType.LPArray, SizeParamIndex := 0)> ByVal pRawInputDevices As RAWINPUTDEVICE(), ByVal uiNumDevices As Integer, ByVal cbSize As Integer) As Boolean
RAWINPUTDEVICE device;
device.Flags = RawInputDeviceFlags.InputSink;
Win32API.RegisterRawInputDevices(device);
public static bool RegisterRawInputDevices(RAWINPUTDEVICE device)
RAWINPUTDEVICE[] devices = new RAWINPUTDEVICE[1]; // Raw input devices.
return RegisterRawInputDevices(devices, 1, Marshal.SizeOf(typeof(RAWINPUTDEVICE))); |