-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using mouse wheel with MOUSE_MODE_CAPTURED is changing mouse position #29559
Labels
Milestone
Comments
I encountered this issue with the _input method, as it's being called with the InputEventMouseMotion event every time the wheel is scrolled. |
yamgent
added a commit
to yamgent/godot
that referenced
this issue
Aug 5, 2019
WM_MOUSEWHEEL and WM_MOUSEHWHEEL report mouse coordinates relative to the screen (see lParam in [1]), rather than to the window like the rest of the mouse events. The current code already makes adjustments to take that into account. However, it only makes the adjustments if the mouse is not captured, and the coordinates are always relative to the screen regardless of whether the mouse is captured or not, so let's fix the code to always consistently apply the adjustments. This fixes godotengine#29559. [1] - https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousewheel
myhalibobo
pushed a commit
to myhalibobo/godot
that referenced
this issue
Sep 3, 2019
WM_MOUSEWHEEL and WM_MOUSEHWHEEL report mouse coordinates relative to the screen (see lParam in [1]), rather than to the window like the rest of the mouse events. The current code already makes adjustments to take that into account. However, it only makes the adjustments if the mouse is not captured, and the coordinates are always relative to the screen regardless of whether the mouse is captured or not, so let's fix the code to always consistently apply the adjustments. This fixes godotengine#29559. [1] - https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousewheel
pchasco
pushed a commit
to pchasco/godot
that referenced
this issue
Oct 23, 2019
WM_MOUSEWHEEL and WM_MOUSEHWHEEL report mouse coordinates relative to the screen (see lParam in [1]), rather than to the window like the rest of the mouse events. The current code already makes adjustments to take that into account. However, it only makes the adjustments if the mouse is not captured, and the coordinates are always relative to the screen regardless of whether the mouse is captured or not, so let's fix the code to always consistently apply the adjustments. This fixes godotengine#29559. [1] - https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousewheel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Godot 3.1.1
Windows 10 64 bits
I use
get_viewport().get_mouse_position()
in order to get a ray to the 3D world from within_physics_update
. However, I found that if I useMOUSE_MODE_CAPTURED
, scrolling the mouse wheel will make the function return bad coordinates, until you move the mouse again. I expect this should not happen, mouse wheel is not supposed to move the mouse in any way.Project:
MousePositionWheel.zip
Run the main scene, notice the mouse position is correctly reported (most often near the center). Then use mouse wheel, you'll see it changes by a lot, until you move the mouse again.
The text was updated successfully, but these errors were encountered: