Refactor KeyCode into Key and Location
This commit is contained in:
parent
534c7dd7b0
commit
64d1ce5532
24 changed files with 1277 additions and 461 deletions
|
|
@ -134,8 +134,8 @@ impl Application for Editor {
|
|||
}
|
||||
|
||||
fn subscription(&self) -> Subscription<Message> {
|
||||
keyboard::on_key_press(|key_code, modifiers| match key_code {
|
||||
keyboard::KeyCode::S if modifiers.command() => {
|
||||
keyboard::on_key_press(|key, modifiers| match key.as_ref() {
|
||||
keyboard::Key::Character("s") if modifiers.command() => {
|
||||
Some(Message::SaveFile)
|
||||
}
|
||||
_ => None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue