Skip to content

Commit afa480b

Browse files
improv: read key nav events on key press to reduce perceived latency
1 parent 7c207e2 commit afa480b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/app.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,9 @@ impl cosmic::Application for CosmicLauncher {
870870
cosmic::iced::Event::PlatformSpecific(PlatformSpecific::Wayland(
871871
wayland::Event::Layer(e, ..),
872872
)) => Some(Message::Layer(e)),
873-
cosmic::iced::Event::Keyboard(iced::keyboard::Event::KeyReleased {
873+
cosmic::iced::Event::Keyboard(iced::keyboard::Event::KeyPressed {
874874
key,
875+
text,
875876
modifiers,
876877
..
877878
}) => match key {
@@ -897,14 +898,6 @@ impl cosmic::Application for CosmicLauncher {
897898
Key::Named(Named::Escape) => Some(Message::Hide),
898899
Key::Named(Named::Tab) => Some(Message::TabRelease),
899900
Key::Named(Named::Alt | Named::Super) => Some(Message::AltRelease),
900-
_ => None,
901-
},
902-
cosmic::iced::Event::Keyboard(iced::keyboard::Event::KeyPressed {
903-
key,
904-
text,
905-
modifiers,
906-
..
907-
}) => match key {
908901
Key::Character(_)
909902
if matches!(status, Status::Ignored)
910903
&& modifiers.is_empty()

0 commit comments

Comments
 (0)