Windows original mouse input

After reading this article “Using High-Definition Mouse Movement” - http://msdn.microsoft.com/en-us/library/windows/desktop/ee418864(v=vs.100).aspx , I assume that you need to use the original input for more accurate readings from input devices.

The article says that the main disadvantage of WM_MOUSEMOVE is that it is limited by the screen resolution.

After a thorough check of the RAWMOUSE structure, I see that lLastX and lLastY are long values, and you get a delta through them.

It seems to me that WM_MOUSEMOVE and WM_INPUT are the same, except that WM_INPUT does not get acceleration (pointer ballistics).

Are WM_MOUSEMOVE and WM_INPUT limited in screen resolution?

If so, what is the use of using WM_INPUT?

+4
source share
2 answers

RAWMOUSE gives you the logical coordinates for the mouse based on the native resolution of the mouse.

That is, you see the actual mouse movement.

Windows will use the mouse speed and acceleration (ballistics) settings to update the cursor position. Of course, the two are not connected - the apparent mouse movement must be interpreted in order to generate cursor movement, otherwise how can more than one mouse be supported?

If you want to control the pointer, as far as I can tell, there is no reason to duplicate Windows mouse ballistics calculations. Just let the windows do it. Therefore, to control the pointer, you should simply use WM_MOUSEMOVE. That is, if you do not want to disable the mouse acceleration settings in your application.

However, if you want to control the POV player (point of view) or use the mouse to control an in-game object, such as a spacecraft flight shortcut, then RAWMOUSE data gives you the best access to mouse movement, and you can implement your own algorithm to convert this to summer yoke movement / pov.

+9
source

The main advantage and reason for using it is that with rawInput you can use two or more mice. I am currently writing a small prototype of a game that is designed to be played by two players with two mice / mices. It is more complicated, but it works, and it’s not bad, because I nod to link external libraries.

+1
source

Source: https://habr.com/ru/post/1410851/


All Articles