Unify keyboard subscriptions into listen
This commit is contained in:
parent
0df5765e2f
commit
7e5b6f6802
9 changed files with 77 additions and 96 deletions
|
|
@ -381,15 +381,16 @@ where
|
|||
program.subscription(&self.state).map(Event::Program);
|
||||
debug::subscriptions_tracked(subscription.units());
|
||||
|
||||
let hotkeys = futures::keyboard::on_key_press(
|
||||
|key, _physical_key, _modifiers| match key {
|
||||
keyboard::Key::Named(keyboard::key::Named::F12) => {
|
||||
Some(Message::ToggleComet)
|
||||
}
|
||||
let hotkeys = futures::keyboard::listen()
|
||||
.filter_map(|event| match event {
|
||||
keyboard::Event::KeyPressed {
|
||||
modified_key:
|
||||
keyboard::Key::Named(keyboard::key::Named::F12),
|
||||
..
|
||||
} => Some(Message::ToggleComet),
|
||||
_ => None,
|
||||
},
|
||||
)
|
||||
.map(Event::Message);
|
||||
})
|
||||
.map(Event::Message);
|
||||
|
||||
let commands = debug::commands().map(Event::Command);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue