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

add functions to check which button triggered a drag start & end #2507

Merged
merged 4 commits into from
Jan 24, 2023

Conversation

lictex
Copy link
Contributor

@lictex lictex commented Dec 26, 2022

currently its hard to figure out which button triggered a drag start & end event:

  • for drag_started, checking response.drag_started() && ui.input().pointer.button_down( ... ) usually works. however this could be false positive when multiple buttons are dragging at the same time.
  • for drag_released, there seems to be no way at all.

to improve this, button_pressed is added to precisely check buttons of drag starts. and make button_released independent of clicks (closes #2094) to check buttons of drag releases.
some utility functions are added to Response for convenience.

Copy link
Owner

@emilk emilk 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!

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@emilk emilk merged commit eee4cf6 into emilk:master Jan 24, 2023
@lictex lictex deleted the 2094 branch January 24, 2023 15:37
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.

Pointer released events do not trigger for drags
2 participants