From abfb5d845fd72ca76348f5ea0ea85ebf7f9a29fa Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 25 Mar 2024 09:32:46 -0600 Subject: [PATCH] Only parse app global shortcuts when ignored by widgets, fixes #120 and #164 --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 433dc9f..5c4ecc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2549,9 +2549,12 @@ impl Application for App { struct ThemeSubscription; subscription::Subscription::batch([ - event::listen_with(|event, _status| match event { + event::listen_with(|event, status| match event { event::Event::Keyboard(keyboard::Event::KeyPressed { modifiers, key, .. }) => { - Some(Message::Key(modifiers, key)) + match status { + event::Status::Ignored => Some(Message::Key(modifiers, key)), + event::Status::Captured => None, + } } event::Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => { Some(Message::Modifiers(modifiers))