Introduce keyboard::on_key_press and on_key_release

Also rename `subscription::events*` to `event::listen*`.
This commit is contained in:
Héctor Ramón Jiménez 2023-09-07 02:45:15 +02:00
parent a56b25b909
commit 08a031cbe5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
14 changed files with 193 additions and 138 deletions

View file

@ -4,9 +4,8 @@ use iced::theme::{Button, Container};
use iced::widget::{button, column, container, image, row, text, text_input};
use iced::window::screenshot::{self, Screenshot};
use iced::{
event, executor, keyboard, subscription, Alignment, Application, Command,
ContentFit, Element, Event, Length, Rectangle, Renderer, Subscription,
Theme,
event, executor, keyboard, Alignment, Application, Command, ContentFit,
Element, Event, Length, Rectangle, Renderer, Subscription, Theme,
};
use ::image as img;
@ -254,7 +253,7 @@ impl Application for Example {
}
fn subscription(&self) -> Subscription<Self::Message> {
subscription::events_with(|event, status| {
event::listen_with(|event, status| {
if let event::Status::Captured = status {
return None;
}