diff options
author | 2024-01-17 08:12:44 +0100 | |
---|---|---|
committer | 2024-01-17 08:12:44 +0100 | |
commit | 0001a6d63642b299531ff089f961732a1bfa2339 (patch) | |
tree | 7b100257baf72dbceccf5c3343abf3a6b9f1db03 /examples/layout | |
parent | c4ba657de86d7606587dad5124f435141258f570 (diff) | |
parent | 985acb2b1532b3e56161bd35201c4a2e21a86b85 (diff) | |
download | iced-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 'examples/layout')
-rw-r--r-- | examples/layout/src/main.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs index 60dabe54..6cf0e570 100644 --- a/examples/layout/src/main.rs +++ b/examples/layout/src/main.rs @@ -71,9 +71,13 @@ impl Application for Layout { } fn subscription(&self) -> Subscription<Message> { - keyboard::on_key_release(|key_code, _modifiers| match key_code { - keyboard::KeyCode::Left => Some(Message::Previous), - keyboard::KeyCode::Right => Some(Message::Next), + use keyboard::key; + + keyboard::on_key_release(|key, _modifiers| match key { + keyboard::Key::Named(key::Named::ArrowLeft) => { + Some(Message::Previous) + } + keyboard::Key::Named(key::Named::ArrowRight) => Some(Message::Next), _ => None, }) } |