I have a thread that captures the state of all input devices every x milliseconds. To do this, I am using GetAsyncKeyState()
for all keys, GetCursorPos()
for mouse x/y, and XInputGetState()
for controller state. What this doesn't report is the mouse's scroll wheel, which isn't expressed in a single value but a change in value, which means it must be determined through a window message (WM_MOUSEWHEEL
).
Is it safe to call PeekMessage()
from this thread (which is not my message pump thread), provided I use my own synchronization?