Introduce keyboard::on_key_press and on_key_release
Also rename `subscription::events*` to `event::listen*`.
This commit is contained in:
parent
a56b25b909
commit
08a031cbe5
14 changed files with 193 additions and 138 deletions
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue