diff options
author | 2023-09-07 02:45:15 +0200 | |
---|---|---|
committer | 2023-09-07 02:45:15 +0200 | |
commit | 08a031cbe5913c249efa7fc82556d5d95f981c4c (patch) | |
tree | 8b8db2279c04393a8b8e39ed0a74b922c91c8dea /runtime/src/window.rs | |
parent | a56b25b9096d47ada3c4349f5b91110dfaa92bf6 (diff) | |
download | iced-08a031cbe5913c249efa7fc82556d5d95f981c4c.tar.gz iced-08a031cbe5913c249efa7fc82556d5d95f981c4c.tar.bz2 iced-08a031cbe5913c249efa7fc82556d5d95f981c4c.zip |
Introduce `keyboard::on_key_press` and `on_key_release`
Also rename `subscription::events*` to `event::listen*`.
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r-- | runtime/src/window.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 5219fbfd..41816967 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -10,7 +10,8 @@ use crate::command::{self, Command}; use crate::core::time::Instant; use crate::core::window::{Event, Icon, Level, Mode, UserAttention}; use crate::core::Size; -use crate::futures::subscription::{self, Subscription}; +use crate::futures::event; +use crate::futures::Subscription; /// Subscribes to the frames of the window of the running application. /// @@ -21,7 +22,7 @@ use crate::futures::subscription::{self, Subscription}; /// In any case, this [`Subscription`] is useful to smoothly draw application-driven /// animations without missing any frames. pub fn frames() -> Subscription<Instant> { - subscription::raw_events(|event, _status| match event { + event::listen_raw(|event, _status| match event { iced_core::Event::Window(Event::RedrawRequested(at)) => Some(at), _ => None, }) |