Ignore captured key presses in global handler
This commit is contained in:
parent
24ccc9bd82
commit
bb1c57bbf5
1 changed files with 5 additions and 4 deletions
|
|
@ -1338,10 +1338,11 @@ impl Application for App {
|
||||||
struct WatcherSubscription;
|
struct WatcherSubscription;
|
||||||
|
|
||||||
let mut subscriptions = vec![
|
let mut subscriptions = vec![
|
||||||
event::listen_with(|event, _status| match event {
|
event::listen_with(|event, status| match event {
|
||||||
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => {
|
Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => match status {
|
||||||
Some(Message::Key(modifiers, key))
|
event::Status::Ignored => Some(Message::Key(modifiers, key)),
|
||||||
}
|
event::Status::Captured => None,
|
||||||
|
},
|
||||||
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
||||||
Some(Message::Modifiers(modifiers))
|
Some(Message::Modifiers(modifiers))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue