Hi all,
I want to obtain the mouse movement win WINAPI. Basically if the cursor is on the left side of the screen and I move the mouse left, I want to sill get a -x value.
I know that this was possible with DirectInput, but I cannot find a WinAPI equivalent. Is there any?
WINAPI Mouse movement diff via WinAPI
DirectInput still works fine for the time being, as there is still no complete replacement.
Raw Input might fit your bill: https://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx
Yeah, Raw Input does but you still need to get the mouse initial position by WINAPI call GetCursorPos unless you now the direction but do not now the position of your cursor
GetRawInputData actually gives your the mouse motion in the X/Y directions, you can call it in response to a WM_INPUT event, after making sure to call RegisterRawInputDevice so that your window actually receives the events.
I second or third using RawInput. Since eventually DirectInput will no longer be supported. It's pretty easy to use too.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement