Only parse app global shortcuts when ignored by widgets, fixes #120 and #164

This commit is contained in:
Jeremy Soller 2024-03-25 09:32:46 -06:00
parent 5410746e1d
commit abfb5d845f
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -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))