I need to detect if the mouse has stopped moving in an FPS game.
I'm capturing the cursor by using Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
.
Because of that I have to use event.relative
to detect relative mouse movement, like this:
if event is InputEventMouseMotion:
var mouse_motion = event.relative
However, the mouse_motion variable will never be (0,0), because the value is no longer updated when the mouse stops moving. This is intended behaviour, but doesn't really help.
Is there a way to detect if the mouse has stopped moving? I could use a short timer that resets every time the mouse moves, but that feels like a workaround.