Skip to content
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

[3.2.1] Mouse clicks not registering if click happened outside button #38126

Closed
DoctorWhoof opened this issue Apr 23, 2020 · 3 comments
Closed

Comments

@DoctorWhoof
Copy link

Godot version:
3.2.1.stable.oficial

OS/device including version:
MacOS 10.15.4 and Windows 10

Issue description:
I'm trying to create an UI where the user can click on a button, then DRAG the mouse over the neighbor buttons, without releasing the left button, to toggle their state.

However, it only works for me on Windows and MacOS if I drag the mouse OUT of the window, then back into it. A user on Linux has reported that it works as expected.

My minimal repro script stores the state of mouse clicks, then uses an "_on_mouse_entered" signal to print a message, but only if the user has already clicked and is dragging.

Steps to reproduce:
Run the minimal project attached. CLICK on a button, and without releasing the left mouse button, DRAG over the neighbor buttons. You should see the "button is drag-pressed!" message printed for each button.

Minimal reproduction project:
Drag-Click Test.zip

@groud groud added this to the 3.2 milestone Apr 24, 2020
@swenner
Copy link
Contributor

swenner commented Apr 24, 2020

I can confirm that it is also broken on Debian GNU/Linux (Gnome) with Godot 3.2.2beta. You have to move the mouse outside of the window to get the mouse entered event. Could be related to #20881

@DoctorWhoof
Copy link
Author

It definitely seems related to #20881. I did some more testing, and the individual buttons can register the "click" just fine when it happens outside their rect (I added a "print"statement to verify it). It's the mouse_enter event that seems to not be working as expected, as far as I can tell. Thanks!

And just in case someone is wondering why this is useful, you can use buttons that behave like that to:

  • Mass toggle the state multiple items, like the Layers in Photoshop, without RSI inducing click-click-clicking on each one
  • Play a sound for each key on a piano roll without releasing the mouse button
  • Make "toddler friendly" UI's (click dragging can be easier than multiple clicks in some situations) in apps for kids, etc.

Thanks!

@akien-mga akien-mga modified the milestones: 3.2, 3.3 Mar 17, 2021
@Calinou
Copy link
Member

Calinou commented Mar 28, 2021

Duplicate of #20881 (same cause).

@Calinou Calinou closed this as completed Mar 28, 2021
@Calinou Calinou removed this from the 3.3 milestone Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants