summaryrefslogtreecommitdiffstats
path: root/examples/stopwatch/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-01-17 08:12:44 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-17 08:12:44 +0100
commit0001a6d63642b299531ff089f961732a1bfa2339 (patch)
tree7b100257baf72dbceccf5c3343abf3a6b9f1db03 /examples/stopwatch/src
parentc4ba657de86d7606587dad5124f435141258f570 (diff)
parent985acb2b1532b3e56161bd35201c4a2e21a86b85 (diff)
downloadiced-0001a6d63642b299531ff089f961732a1bfa2339.tar.gz
iced-0001a6d63642b299531ff089f961732a1bfa2339.tar.bz2
iced-0001a6d63642b299531ff089f961732a1bfa2339.zip
Merge pull request #2169 from iced-rs/update-winit
Update `winit` to `0.29`
Diffstat (limited to '')
-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,
}
}