From 5598f3931504d950951aa01c5257d6b0229fc0ac Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 27 Mar 2023 15:45:24 -0600 Subject: [PATCH] GOT IT only subscribe to ignored events to capture textinput free keypresses --- src/gui.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index fe5dbc8..941078b 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -323,8 +323,11 @@ impl Application for Main { fn subscription(&self) -> Subscription { 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 { }; } } +