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
MouseInput has a boolean inside of it called .isPressed. It is set to true when MOUSE_DOWN event is dispatched, and to false when MOUSE_UP event is dispatched. When mouse leaves the area of the canvas and LMB gets released, .isPressed boolean is stuck at true until new MOUSE_DOWN event is triggered. In my cause this is troublesome, because my game is primarily a scrollview.
When LMB gets released outside of the canvas and then the cursor returns to the game, the scrollview scrolls even though LMB is not pressed.
2024-07-15.12-51-00.chrome.mp4
For my game, I've hacked my way around the engine and trigger a MOUSE_UP when mouseleave event is dispatched.
For my game in particular, this works great, but I do realize that this might be a bad solution for other games.
Perhaps the solution should be to respond to mouseleave event only for scrollview?
Either way, that fixed my issue:
2024-07-15.13-00-31.chrome.mp4
Relevant error log output
No response
Steps to reproduce
Create a scrollview the size of the game
hold left mouse button to start scrolling
leave the bounds of the canvas
release the left mouse button
return cursor to the scrollview
scrollview is getting scrolled even without pressed left mouse button
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
Cocos Creator version
3.8.2
System information
Windows 10
Issue description
MouseInput
has a boolean inside of it called.isPressed
. It is set totrue
when MOUSE_DOWN event is dispatched, and tofalse
when MOUSE_UP event is dispatched. When mouse leaves the area of the canvas and LMB gets released,.isPressed
boolean is stuck attrue
until new MOUSE_DOWN event is triggered. In my cause this is troublesome, because my game is primarily a scrollview.When LMB gets released outside of the canvas and then the cursor returns to the game, the scrollview scrolls even though LMB is not pressed.
2024-07-15.12-51-00.chrome.mp4
For my game, I've hacked my way around the engine and trigger a
MOUSE_UP
whenmouseleave
event is dispatched.For my game in particular, this works great, but I do realize that this might be a bad solution for other games.
Perhaps the solution should be to respond to
mouseleave
event only for scrollview?Either way, that fixed my issue:
2024-07-15.13-00-31.chrome.mp4
Relevant error log output
No response
Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: