GOT IT only subscribe to ignored events to capture textinput free keypresses

master
Bel LaPointe 2023-03-27 15:45:24 -06:00
parent ff2c41cf69
commit 5598f39315
1 changed files with 6 additions and 2 deletions

View File

@ -323,8 +323,11 @@ impl Application for Main {
fn subscription(&self) -> Subscription<Message> {
return subscription::Subscription::batch(vec![
subscription::events_with(|event, _| match event {
iced::Event::Keyboard(_) => Some(Message::EventOccurred(event)),
subscription::events_with(|event, status| match status {
iced::event::Status::Ignored => match event {
iced::Event::Keyboard(_) => Some(Message::EventOccurred(event)),
_ => None,
},
_ => None,
}),
every(std::time::Duration::from_millis(5000)).map(|_| Message::Tick),
@ -408,3 +411,4 @@ impl Feedback {
};
}
}