Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "RAWINPUT" in [All]

Structures

.
Summary
.

    public struct RawInput

.

        public RawInputHeader Header;

.

        public RawInputMouse Mouse;

.

        public RawInputHid Hid;

.

    public struct RawInput

.

        public RawInputHeader Header;

.

    Public Structure RawInput

.

    Public Header As RAWINPUTHEADER

.
Documentation
[RAWINPUT] on MSDN
.

public struct RAWINPUTDEVICE

.

    public RawInputDeviceFlags Flags;

.

Public Structure RAWINPUTDEVICE

.

    Public Flags As RawInputDeviceFlags

.

HIDUsagePage, HIDUsage, RawInputDeviceFlags

.
Documentation
[RAWINPUTDEVICE] on MSDN
.

    public struct RAWINPUTHEADER

.

        public RawInputType Type;

.

    Public Structure RawInputHeader

.

        Public Type As RawInputType

.
Documentation
[RAWINPUTHEADER] on MSDN
.

    public struct RAWINPUTHID

.

Structure RAWINPUTHID

.
Documentation
[RAWINPUTHID] on MSDN
.
Summary
.

Structure RAWINPUTMOUSE

.
Documentation
[RAWINPUTMOUSE] on MSDN

Enums

.
Summary
Enumeration containing the HID usage flags for use with RAWINPUTDEVICE.
.
Summary
Enumeration containing HID usage pages for use with RAWINPUTDEVICE.
.

    QS_RAWINPUT = 0x400

.

    QS_RAWINPUT = &H400

.

  QS_RAWINPUT = 0x0400,

.

  QS_INPUT = QS_MOUSE | QS_KEY | QS_RAWINPUT,

.

   QS_RAWINPUT = &H400

.
Summary
.

    public enum RawInputCommand

.

Enum RawInputCommand

.
Documentation
[RawInputCommand] on MSDN
.
Summary
.

public enum RawInputDeviceFlags

.

Public Enum RawInputDeviceFlags

.
Documentation
[RawInputDeviceFlags] on MSDN
.
Summary
.

    public enum RawInputType

.

    Public Enum RawInputType

.
Documentation
[RawInputType] on MSDN
.
Summary
Flags used for scancode states in the RAWINPUTKEYBOARD structure.
.
Summary
Enumeration for button states for use with RAWINPUTMOUSE.
.
Summary
Flags for use with the RAWINPUTMOUSE structure.

user32

.

        QS_RAWINPUT =       0x0400,

.

        QS_INPUT = (QS_MOUSE | QS_KEY | QS_RAWINPUT),

.

    /// <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);

.

    <DllImport("user32.dll", CharSet:=CharSet.Auto, EntryPoint:="GetRawInputData", SetLastError:=True)>

.

    Function GetRawInputData(hRawInput As IntPtr,

.

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)

.
Documentation
[GetRawInputData] on MSDN
.

    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);

.
Documentation
.
Summary
The GetRawInputDeviceInfo function gets information about the raw input device.
.

static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, IntPtr pData, ref uint pcbSize);

.

[DllImport("user32.dll", SetLastError = true, EntryPoint = "GetRawInputDeviceInfoA")]

.

public static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, ref RID_DEVICE_INFO pData, ref uint pcbSize);

.

[DllImport("user32.dll", SetLastError = true, EntryPoint = "GetRawInputDeviceInfoA", CharSet = CharSet.Ansi)]

.

public static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, StringBuilder 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

.

        var firstCall = GetRawInputDeviceInfo(deviceHandle, RIDI_DEVICENAME, devBufer, ref returnedDataSize);

.

        var secondCall = GetRawInputDeviceInfo(deviceHandle, RIDI_DEVICEINFO, ref devInfo, ref returnedDataSize);

.

    ' First half heavily borrowed from C# example on GetRawInputDeviceList()

.

         Dim dwSize As Integer = CInt(Marshal.SizeOf(GetType(RAWINPUTDEVICELIST)))

.

         Dim retValue As UInt32 = GetRawInputDeviceList(IntPtr.Zero, deviceCount, dwSize)

.

         retValue = GetRawInputDeviceList(devPtr, deviceCount, dwSize)

.

         Dim deviceList As RAWINPUTDEVICELIST

.

         Dim rawDevs As New Dictionary(Of IntPtr, RawInputDeviceType)

.

         deviceList = CType(Marshal.PtrToStructure(New IntPtr((devPtr.ToInt32() + (dwSize * i))), GetType(RAWINPUTDEVICELIST)), RAWINPUTDEVICELIST)

.

         If deviceList.dwType = RawInputDeviceType.KEYBOARD Then

.

         For Each itm As KeyValuePair(Of IntPtr, RawInputDeviceType) In rawDevs

.

         GetRawInputDeviceInfo(itm.Key, DeviceInfoTypes.RIDI_DEVICENAME, IntPtr.Zero, pcbSize)

.

         GetRawInputDeviceInfo(itm.Key, DeviceInfoTypes.RIDI_DEVICENAME, pData, pcbSize)

.
Documentation
[GetRawInputDeviceInfo] on MSDN
.
Summary
The GetRawInputDeviceList function enumerates the raw input devices attached to the system.
.

    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);

.
Documentation
[GetRawInputDeviceList] on MSDN
.

/// <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

.

        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)));

.
Documentation
[RegisterRawInputDevices] on MSDN

 
Access PInvoke.net directly from VS: