Skip to content

ParameterInput: Ignore mouse events when not visible #236

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

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

dylanmccall
Copy link
Contributor

Instead of using only _input to process events, use _gui_input to watch for mouse button events that are understood to be for an input control, but use _input to watch for mouse movement events which may occur outside of the control.

To work within the rules of Godot's GUI event system, we need to do this in a control which is a child of each input control. This is achieved using draggable_overlay.tscn.

@dylanmccall dylanmccall requested a review from manuq September 26, 2024 19:03
@dylanmccall dylanmccall marked this pull request as draft September 26, 2024 20:00
@dylanmccall dylanmccall force-pushed the parameter-input-drag-fixes branch from cb6388c to 80526a2 Compare September 26, 2024 20:07
@dylanmccall dylanmccall marked this pull request as ready for review September 26, 2024 20:35
@dylanmccall dylanmccall force-pushed the parameter-input-drag-fixes branch 3 times, most recently from 832060d to 966f5af Compare September 26, 2024 22:01
@dylanmccall dylanmccall force-pushed the parameter-input-drag-fixes branch from 966f5af to 5606e74 Compare September 26, 2024 22:04
Instead of emitting mouse_down and mouse_up signals, change DragDropArea
to detect drag gestures by monitoring mouse input events.
Instead of using ParameterInput's own input events, add a DragDropArea
for each input component. This allows us to use _gui_input events so
events are correctly filtered based on z order and visibility.
Copy link
Member

@dbnicholson dbnicholson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@dbnicholson dbnicholson merged commit 69fccc0 into main Sep 27, 2024
3 checks passed
@dbnicholson dbnicholson deleted the parameter-input-drag-fixes branch September 27, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants