Add #5215: Add onClientMouseMove event for raw mouse delta - #5237
Open
x6c85 wants to merge 2 commits into
Open
Conversation
Uses Windows Raw Input (WM_INPUT) to capture mouse movement deltas regardless of cursor visibility or camera target. Unlike onClientCursorMove which reports clamped screen coordinates, this event fires deltaX/deltaY values that work even when the cursor is hidden.
x6c85
force-pushed
the
feature/5215-onClientMouseMove
branch
from
August 19, 2026 13:57
3c0c271 to
b38bddc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
onClientMouseMoveevent that fires raw mouse deltas (deltaX, deltaY) using Windows Raw Input (WM_INPUT). UnlikeonClientCursorMovewhich only reports clamped screen coordinates, this event works regardless of cursor visibility or camera target.Motivation
Fixes #5215.
onClientCursorMovearguments don't update when the cursor is hidden and the camera isn't targeting an entity, because it relies onWM_MOUSEMOVEwhich gives absolute clamped coordinates. This new event uses Raw Input to capture actual mouse deltas, enabling mouse flick detection for anti-cheats and first-person camera implementations.Test plan
addEventHandler("onClientMouseMove", root, function(dx, dy) outputChatBox(dx.." "..dy) end)- move mouse with cursor hidden, verify deltas are reported.showCursor(true)- bothonClientCursorMoveandonClientMouseMovefire.onClientMouseMovestill reports deltas whileonClientCursorMovecoordinates stay clamped.Checklist