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

egui-winit: Don't consume clipboard shortcuts #3812

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

Dinnerbone
Copy link
Contributor

@Dinnerbone Dinnerbone commented Jan 12, 2024

This breaking change seems to have snuck in during #3649. Previously it would never consume these, today it consumes them unconditionally, and with this change it'll only consume them if egui wants text input never consume them.

This is a blocker for updating our application, sadly :(

crates/egui-winit/src/lib.rs Show resolved Hide resolved
@Dinnerbone Dinnerbone changed the title Don't unconditionally consume some keyboard shortcuts Don't consume clipboard shortcuts Jan 12, 2024
@rustbasic
Copy link
Contributor

@emilk @Dinnerbone
My program uses something like below:

    if ui.input_mut(|i| i.events.last() == Some(&Event::Copy))
    || ui.input_mut(|i| i.events.last() == Some(&Event::Cut))
    {

    }
  1. I think it would be a good idea to consume the keycode when the key is released.
    ( or )
  2. I think it would be nice to have the ability to turn on/off events or various basic keys (ex: Ctrl+A, Ctrl+C, Ctrl+K Ctrl+Z...) in TextEdit.

@emilk emilk added the egui-winit porblems related to winit label Jan 17, 2024
@emilk emilk changed the title Don't consume clipboard shortcuts egui-winit: Don't consume clipboard shortcuts Jan 17, 2024
@emilk
Copy link
Owner

emilk commented Jan 17, 2024

@rustbasic let's consider what to do there in a separate issue or PR. It feels like a much larger issue.

For now I think it makes sense to revert to the old behavior of only considering Copy/Cut/Paste consumed if egui has wants_keyboard_input set, i.e. if a TextEdit is selected.

@emilk emilk merged commit 221a77d into emilk:master Jan 17, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui-winit porblems related to winit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants