You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any mouse interaction outside the game window will correctly not fire any InputEventMouse. But if the user clicks and drags something inside the window, an InputEventMouse is always fired, even when the mouse leaves the window, which is to be expected. https://github.com/user-attachments/assets/b690596e-b2de-4e1b-8f53-249ef093cd54
Code in this example:
However, if the window is not focused before the click and drag, no InputEventMouse is fired when the mouse leaves the window.
This can lead to an unexpected situation when a user clicks inside and releases outside the window; Since no InputMouseEventButton is fired outside the window, pressed is never updated. https://github.com/user-attachments/assets/de45b373-b411-46c0-8f4e-c8f971094df5
As a workaround, you can do your mouse logic inside _process instead of _input.
Run the project and see that if the window is not focused before, clicking and dragging does not fire any InputMouseEvent when the mouse is outside the window.
Tested versions
Reproducible in: v4.4.dev6.official [1f47e4c], v4.3.stable.official [77dcf97]
System information
Godot v4.4.dev6 - Windows 10.0.19045 - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 SUPER (NVIDIA; 31.0.15.3713) - AMD Ryzen 5 3600 6-Core Processor (12 threads)
Issue description
Any mouse interaction outside the game window will correctly not fire any
InputEventMouse
. But if the user clicks and drags something inside the window, anInputEventMouse
is always fired, even when the mouse leaves the window, which is to be expected.https://github.com/user-attachments/assets/b690596e-b2de-4e1b-8f53-249ef093cd54
Code in this example:
However, if the window is not focused before the click and drag, no
InputEventMouse
is fired when the mouse leaves the window.This can lead to an unexpected situation when a user clicks inside and releases outside the window; Since no
InputMouseEventButton
is fired outside the window,pressed
is never updated.https://github.com/user-attachments/assets/de45b373-b411-46c0-8f4e-c8f971094df5
As a workaround, you can do your mouse logic inside
_process
instead of_input
.Steps to reproduce
InputMouseEvent
when the mouse is outside the window.Minimal reproduction project (MRP)
MouseEventOutsideWindowBug.zip
The text was updated successfully, but these errors were encountered: