summaryrefslogtreecommitdiffstats
path: root/examples/stopwatch/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-19 20:41:52 +0100
commit1781068e1c3a65551db1e832fdbaddba99124051 (patch)
tree60e0b3854cc0541712572fbb0e56f14435951ea9 /examples/stopwatch/src/main.rs
parent41dec5bd203ff5b1574a33a17d5f7358ae1beea2 (diff)
parent7ae7fcb89855002519bab752fd3686106ce448db (diff)
downloadiced-1781068e1c3a65551db1e832fdbaddba99124051.tar.gz
iced-1781068e1c3a65551db1e832fdbaddba99124051.tar.bz2
iced-1781068e1c3a65551db1e832fdbaddba99124051.zip
Merge branch 'master' into remove-vertex-indexing
Diffstat (limited to 'examples/stopwatch/src/main.rs')
-rw-r--r--examples/stopwatch/src/main.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/stopwatch/src/main.rs b/examples/stopwatch/src/main.rs
index 0b0f0607..8a0674c1 100644
--- a/examples/stopwatch/src/main.rs
+++ b/examples/stopwatch/src/main.rs
@@ -86,12 +86,16 @@ impl Application for Stopwatch {
};
fn handle_hotkey(
- key_code: keyboard::KeyCode,
+ key: keyboard::Key,
_modifiers: keyboard::Modifiers,
) -> Option<Message> {
- match key_code {
- keyboard::KeyCode::Space => Some(Message::Toggle),
- keyboard::KeyCode::R => Some(Message::Reset),
+ use keyboard::key;
+
+ match key.as_ref() {
+ keyboard::Key::Named(key::Named::Space) => {
+ Some(Message::Toggle)
+ }
+ keyboard::Key::Character("r") => Some(Message::Reset),
_ => None,
}
}