Skip to content

Can't add other modifiers to Tab or Escape for shortcuts #5878

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

Open
barries opened this issue Apr 6, 2025 · 0 comments
Open

Can't add other modifiers to Tab or Escape for shortcuts #5878

barries opened this issue Apr 6, 2025 · 0 comments
Labels
bug Something is broken

Comments

@barries
Copy link

barries commented Apr 6, 2025

Describe the bug

This code in memory/mod.rs makes it seem like we can't implement Ctrl+Tab (for example) or Ctrl+Escape hotkeys in the normal way in widgets--i.e. during update(). Or is there some graceful way to handle this in egui that I'm missing?

If not, would a PR limiting this to not having Ctrl, Alt, or Cmd pressed be accepted?

for event in &new_input.events {
    if !event_filter.matches(event) {
        if let crate::Event::Key {
            key,
            pressed: true,
            modifiers,
            ..
        } = event
        {
            if let Some(cardinality) = match key {
                ...
                crate::Key::Tab => {
                    if modifiers.shift {
                        Some(FocusDirection::Previous)
                    } else {
                        Some(FocusDirection::Next)
                    }
                }
                crate::Key::Escape => {
                    self.focused_widget = None;
                    Some(FocusDirection::None)
                }
                _ => None,
            } {
@barries barries added the bug Something is broken label Apr 6, 2025
@barries barries changed the title Can't add other modifiers on top of Tab Can't add other modifiers to Tab or Escape for shortcuts Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant