最終更新:  

Raw Input の変更点


[[Win32 API]]

The raw input API provides a stable and robust way for applications to accept raw input from any [[HID]], including the keyboard and mouse.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx

*メモ [#yd769fb6]
-[[Windows XP]]~

*API [#o2e0d1bb]


**構造体 [#d2e76e52]

-[[RAWHID]]
#geshi(){{
typedef struct tagRAWHID {
  DWORD dwSizeHid;
  DWORD dwCount;
  BYTE  bRawData[1];
} RAWHID, *PRAWHID, *LPRAWHID;
}}
-[[RAWINPUT]]
#geshi(){{
typedef struct tagRAWINPUT {
  RAWINPUTHEADER header;
  union {
    RAWMOUSE    mouse;
    RAWKEYBOARD keyboard;
    RAWHID      hid;
  } data;
} RAWINPUT, *PRAWINPUT, *LPRAWINPUT;
}}
--[[RAWINPUTHEADER]]
--[[RAWMOUSE]]
--[[RAWKEYBOARD]]
--[[RAWHID]]
#geshi(){{
typedef struct tagRAWHID {
  DWORD dwSizeHid;
  DWORD dwCount;
  BYTE  bRawData[1];
} RAWHID, *PRAWHID, *LPRAWHID;
}}


-[[RAWINPUTDEVICE]]
#geshi(){{
typedef struct tagRAWINPUTDEVICE {
  USHORT usUsagePage;
  USHORT usUsage;
  DWORD  dwFlags;
  HWND   hwndTarget;
} RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
}}
--[[Usage Page]]と[[Usage ID]]を指定。
-[[RAWINPUTDEVICELIST]]
-[[RAWINPUTHEADER]]
-[[RAWKEYBOARD]]
-[[RAWMOUSE]]

-[[RID_DEVICE_INFO]]
-[[RID_DEVICE_INFO_HID]]
-[[RID_DEVICE_INFO_KEYBOARD]]
-[[RID_DEVICE_INFO_MOUSE]]

**関数 [#kd27a01d]
-[[RegisterRawInputDevices]]
-[[DefRawInputProc]]
-[[GetRawInputBuffer]]
-[[GetRawInputData]]
-[[GetRawInputDeviceList]]
-[[GetRawInputDeviceInfo]]
-[[GetRegisteredRawInputDevices]]


**[[ウィンドウメッセージ]] [#s2a50e4f]
-[[WM_INPUT]]
-[[WM_INPUT_DEVICE_CHANGE]]

*メモ [#he39f107]
-既存の仕組みは[[WM_MOUSEMOVE]]とかを受け取るが、[[Raw Input]] APIは[[WM_INPUT]]メッセージを処理する。

*例 [#xe3827b3]
-http://msdn.microsoft.com/en-us/library/windows/desktop/ms645546(v=vs.85).aspx#registering_rawinput

*複数キーボード [#k270dc62]
-http://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard

*参考 [#of082d13]
-http://members.jcom.home.ne.jp/toya.hiroshi/ui/aboutrawinput.html
-http://www.codeproject.com/Articles/381673/Using-the-RawInput-API-to-Process-MultiTouch-Digit
-https://github.com/MediaPortal/IR-Server-Suite/blob/561e370d48b8fe110ef5c22f16d68a3d3ed2357e/IR%20Server%20Suite/IR%20Server%20Plugins/Imon%20USB%20Receivers/Imon%20USB%20Receivers.cs
*関連 [#abd954ea]
-[[HID]]