Game Development Community

WM_INPUT (More precise mouse aiming)

by Aaron ward · in Torque 3D Professional · 06/08/2012 (4:32 pm) · 2 replies

Could someone (Preferably an employee) point me in the right direction of implementing WM_INPUT in order to replace WM_MOUSEMOVE?

Just a brief overview of what would need to be changed.

I think the whole community would be very appreciative.

#1
06/11/2012 (7:17 am)
Here's the MSDN article on implementing the use of WM_INPUT for mouse events: Taking Advantage of High-Definition Mouse Movement.

You will need to register the generic mouse HID in order to receive those mouse events via WM_INPUT messages. The best place I could think of right now to put that code, as provided in the MSDN article linked above, is probably within the WM_CREATE message handler within Engine/source/windowManager/win32/win32Window.cpp of function:
LRESULT PASCAL Win32Window::WindowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )

You need to implement the WM_INPUT message handler in the following function within Engine/source/windowManager/win32/winDispatch.cpp:
static bool _dispatch(HWND hWnd,UINT message,WPARAM wParam,WPARAM lParam)

You will also need to change it to where the WM_MOUSEMOVE events are now ignored once you're done with the WM_INPUT handler and probably will also want to drop WM_INPUT messages in the same places that RemoveMessages() function is being called to drop WM_MOUSEMOVE messages.

Have fun. :)
#2
06/12/2012 (4:14 pm)
Thank you so much Nathan, I really appreciate it

:)