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

Consume escape keystroke when bailing out from a drag operation #5433

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

abey79
Copy link
Collaborator

@abey79 abey79 commented Dec 4, 2024

Consume the escape keystroke when it's used to bail out of a drag-and-drop operation.

Successfully tested with rerun (aka ESCaping from a drag no longer deselects the current selection).

@abey79 abey79 added feature New feature or request egui drag-and-drop labels Dec 4, 2024
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.

Nice!

Copy link

github-actions bot commented Dec 4, 2024

Preview available at https://egui-pr-preview.github.io/pr/5433-antoine/dnd-consume-escape
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@abey79 abey79 merged commit f687b27 into master Dec 4, 2024
46 checks passed
@abey79 abey79 deleted the antoine/dnd-consume-escape branch December 4, 2024 16:35
abey79 added a commit that referenced this pull request Dec 9, 2024
emilk pushed a commit that referenced this pull request Dec 9, 2024
I introduced this in #5433.

TL;DR: there are two termination conditions for drag-and-drop
operations:
- ESC
- release mouse

The former _must_ happen at frame start (to properly capture the
keystroke). The latter _must_ happen at end-of-frame (to _not_ shadow
the mouse release event from user code).

This is now properly documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drag-and-drop egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants