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

Mark all keys as up if the app loses focus #5743

Merged
merged 1 commit into from
Feb 25, 2025
Merged

Conversation

emilk
Copy link
Owner

@emilk emilk commented Feb 24, 2025

In Rerun, pressing Cmd+S brings up a save dialog using rfd, but we get not key-up event for the S key (in winit).
This leads to S being mistakenly marked as down when we switch back to the app.

This PR takes the safe route and marks all keys as up when an egui app loses focus.

@emilk emilk added bug Something is broken eframe Relates to epi and eframe egui-winit porblems related to winit egui labels Feb 24, 2025
@emilk emilk changed the title Mark all keys as up if the app looses focus Mark all keys as up if the app loses focus Feb 24, 2025
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5743-emilkfix-sticky-keys
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Copy link
Collaborator

@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

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

Nice!

@emilk emilk merged commit 6a96612 into master Feb 25, 2025
50 checks passed
@emilk emilk deleted the emilk/fix-sticky-keys branch February 25, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken eframe Relates to epi and eframe egui egui-winit porblems related to winit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants