Skip to content

Commit ac63690

Browse files
committed
anyrun: Added shift modifier support, and made Tab and Shift+Tab do the expected actions by default
1 parent cf14451 commit ac63690

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

anyrun/src/app.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ impl Component for App {
336336
keybind.key == key
337337
&& keybind.ctrl == modifier.contains(gdk::ModifierType::CONTROL_MASK)
338338
&& keybind.alt == modifier.contains(gdk::ModifierType::ALT_MASK)
339+
&& keybind.shift == modifier.contains(gdk::ModifierType::SHIFT_MASK)
339340
}) {
340341
sender.input(AppMsg::Action(*action));
341342
}

anyrun/src/config.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,45 @@ impl Config {
8888
Keybind {
8989
ctrl: false,
9090
alt: false,
91+
shift: false,
9192
key: gdk::Key::Escape,
9293
action: Action::Close,
9394
},
9495
Keybind {
9596
ctrl: false,
9697
alt: false,
98+
shift: false,
9799
key: gdk::Key::Return,
98100
action: Action::Select,
99101
},
100102
Keybind {
101103
ctrl: false,
102104
alt: false,
105+
shift: false,
103106
key: gdk::Key::Up,
104107
action: Action::Up,
105108
},
106109
Keybind {
107110
ctrl: false,
108111
alt: false,
112+
shift: false,
109113
key: gdk::Key::Down,
110114
action: Action::Down,
111115
},
116+
Keybind {
117+
ctrl: false,
118+
alt: false,
119+
shift: true,
120+
key: gdk::Key::ISO_Left_Tab,
121+
action: Action::Up,
122+
},
123+
Keybind {
124+
ctrl: false,
125+
alt: false,
126+
shift: false,
127+
key: gdk::Key::Tab,
128+
action: Action::Down,
129+
},
112130
]
113131
}
114132
}
@@ -190,6 +208,8 @@ pub struct Keybind {
190208
pub ctrl: bool,
191209
#[serde(default)]
192210
pub alt: bool,
211+
#[serde(default)]
212+
pub shift: bool,
193213
#[serde(deserialize_with = "Keybind::deserialize_key")]
194214
pub key: gdk::Key,
195215
pub action: Action,

0 commit comments

Comments
 (0)