GOT IT only subscribe to ignored events to capture textinput free keypresses
parent
ff2c41cf69
commit
5598f39315
|
|
@ -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 {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue