Raw Input... How?

Started by
13 comments, last by shurcool 12 years, 10 months ago
RTFM ?
Advertisement

RTFM ?


raw input isn't well documented.

At its core raw input messages are USB HID device commands for mouse, touch screen/tablet/touchpad, and keyboard devices. The various magic numbers match to the numbers in the USB specs for those types of HID devices.

In addition, unless you are doing a purely fullscreen D3D application, the nolegacy option for mouse input is not a good choice. Its much easier to filter the message based on the mouse location and let the normal mouse messages get sent and processed for client areas outside your game HWND, (for clicking the 'X' close button, mouse dragging your frames around, resizing the window frames etc).
http://www.gearboxsoftware.com/
How much on average can one expect the latency to be improved over WM_MOUSEMOVE? And how much difference between doing GetRawInputData on WM_INPUT, vs GetRawInputBuffer? What about plain async calls to GetCursorPos? I'm assuming the latter gets the coordinates of the hardware cursor.
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)
I'm confident you won't notice any performance difference between raw input and normal input as long as your message handler processes all pending messages and not just the first one. Messages don't come every frame, but when they do they tend to come in batches and there are often a bunch of system-related messages that you don't specifically care about. In any case, the overhead of processing input messages is so insignificant that you're far better off putting effort into other things like the rendering system and game logic.
As far as I know, the main benefit of using raw input is for more precise, acceleration-free delta mouse movements.

http://msdn.microsoft.com/en-us/library/ee418864(v=VS.85).aspx

This topic is closed to new replies.

Advertisement