最終更新:2014-12-02 (火) 03:41:30 (3596d)
Raw Input
Top / Raw Input
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
メモ
API
構造体
- RAWINPUT
typedef struct tagRAWINPUT { RAWINPUTHEADER header; union { RAWMOUSE mouse; RAWKEYBOARD keyboard; RAWHID hid; } data; } RAWINPUT, *PRAWINPUT, *LPRAWINPUT;
- RAWINPUTDEVICE
typedef struct tagRAWINPUTDEVICE { USHORT usUsagePage; USHORT usUsage; DWORD dwFlags; HWND hwndTarget; } RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
- Usage PageとUsage IDを指定。
- RAWINPUTDEVICELIST?
関数
- RegisterRawInputDevices
- DefRawInputProc?
- GetRawInputBuffer?
- GetRawInputData
- GetRawInputDeviceList
- GetRawInputDeviceInfo
- GetRegisteredRawInputDevices?
ウィンドウメッセージ
メモ
- 既存の仕組みはWM_MOUSEMOVEとかを受け取るが、Raw Input APIはWM_INPUTメッセージを処理する。
例
複数キーボード
参考
- 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 Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs