summaryrefslogtreecommitdiffstats
path: root/examples/modal
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 13:28:00 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 13:28:00 +0100
commit64d1ce5532f55d152fa5819532a138da2dca1a39 (patch)
tree1a242bde122b5e715f2e980c5541353e2ae8b048 /examples/modal
parent534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0 (diff)
downloadiced-64d1ce5532f55d152fa5819532a138da2dca1a39.tar.gz
iced-64d1ce5532f55d152fa5819532a138da2dca1a39.tar.bz2
iced-64d1ce5532f55d152fa5819532a138da2dca1a39.zip
Refactor `KeyCode` into `Key` and `Location`
Diffstat (limited to 'examples/modal')
-rw-r--r--examples/modal/src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/modal/src/main.rs b/examples/modal/src/main.rs
index d1cc7bb0..963c839e 100644
--- a/examples/modal/src/main.rs
+++ b/examples/modal/src/main.rs
@@ -1,6 +1,7 @@
use iced::event::{self, Event};
use iced::executor;
use iced::keyboard;
+use iced::keyboard::key;
use iced::theme;
use iced::widget::{
self, button, column, container, horizontal_space, pick_list, row, text,
@@ -85,7 +86,7 @@ impl Application for App {
}
Message::Event(event) => match event {
Event::Keyboard(keyboard::Event::KeyPressed {
- key_code: keyboard::KeyCode::Tab,
+ key: keyboard::Key::Named(key::Named::Tab),
modifiers,
..
}) => {
@@ -96,7 +97,7 @@ impl Application for App {
}
}
Event::Keyboard(keyboard::Event::KeyPressed {
- key_code: keyboard::KeyCode::Escape,
+ key: keyboard::Key::Named(key::Named::Escape),
..
}) => {
self.hide_modal();