From 68ba8057927cdc95797cb11e0d64f7c905fe37e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Sat, 24 Aug 2024 02:09:44 +0200 Subject: [PATCH] feat: shift-alt-tab --- src/app.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 08fe7eb..2e54bf6 100644 --- a/src/app.rs +++ b/src/app.rs @@ -146,6 +146,7 @@ pub enum Message { InputChanged(String), Backspace, TabPress, + ShiftTabPress, CompleteFocusedId(Id), Activate(Option), Context(usize), @@ -307,6 +308,10 @@ impl cosmic::Application for CosmicLauncher { )); } Message::TabPress => {} + Message::ShiftTabPress if self.alt_tab => { + self.focus_previous(); + } + Message::ShiftTabPress => {} Message::CompleteFocusedId(id) => { let i = RESULT_IDS .iter() @@ -876,7 +881,6 @@ impl cosmic::Application for CosmicLauncher { }, cosmic::iced::Event::Keyboard(iced::keyboard::Event::KeyPressed { key, - text, modifiers, .. }) => match key { @@ -900,6 +904,7 @@ impl cosmic::Application for CosmicLauncher { Some(Message::KeyboardNav(keyboard_nav::Message::FocusNext)) } Key::Named(Named::Escape) => Some(Message::Hide), + Key::Named(Named::Tab) if modifiers.shift() => Some(Message::ShiftTabPress), Key::Named(Named::Tab) => Some(Message::TabPress), Key::Named(Named::Backspace) if matches!(status, Status::Ignored) && modifiers.is_empty() =>