GOT IT only subscribe to ignored events to capture textinput free keypresses
This commit is contained in:
@@ -323,9 +323,12 @@ impl Application for Main {
|
|||||||
|
|
||||||
fn subscription(&self) -> Subscription<Message> {
|
fn subscription(&self) -> Subscription<Message> {
|
||||||
return subscription::Subscription::batch(vec![
|
return subscription::Subscription::batch(vec![
|
||||||
subscription::events_with(|event, _| match event {
|
subscription::events_with(|event, status| match status {
|
||||||
|
iced::event::Status::Ignored => match event {
|
||||||
iced::Event::Keyboard(_) => Some(Message::EventOccurred(event)),
|
iced::Event::Keyboard(_) => Some(Message::EventOccurred(event)),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
},
|
||||||
|
_ => None,
|
||||||
}),
|
}),
|
||||||
every(std::time::Duration::from_millis(5000)).map(|_| Message::Tick),
|
every(std::time::Duration::from_millis(5000)).map(|_| Message::Tick),
|
||||||
]);
|
]);
|
||||||
@@ -408,3 +411,4 @@ impl Feedback {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user