diff options
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r-- | sway/input/keyboard.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 5fc8a806..fb1fe7b5 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -264,31 +264,27 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { | |||
264 | } | 264 | } |
265 | 265 | ||
266 | // Identify and execute active pressed binding | 266 | // Identify and execute active pressed binding |
267 | struct sway_binding *next_repeat_binding = NULL; | 267 | struct sway_binding *binding = NULL; |
268 | if (event->state == WLR_KEY_PRESSED) { | 268 | if (event->state == WLR_KEY_PRESSED) { |
269 | struct sway_binding *binding_pressed = NULL; | ||
270 | get_active_binding(&keyboard->state_keycodes, | 269 | get_active_binding(&keyboard->state_keycodes, |
271 | config->current_mode->keycode_bindings, &binding_pressed, | 270 | config->current_mode->keycode_bindings, &binding, |
272 | code_modifiers, false, input_inhibited); | 271 | code_modifiers, false, input_inhibited); |
273 | get_active_binding(&keyboard->state_keysyms_translated, | 272 | get_active_binding(&keyboard->state_keysyms_translated, |
274 | config->current_mode->keysym_bindings, &binding_pressed, | 273 | config->current_mode->keysym_bindings, &binding, |
275 | translated_modifiers, false, input_inhibited); | 274 | translated_modifiers, false, input_inhibited); |
276 | get_active_binding(&keyboard->state_keysyms_raw, | 275 | get_active_binding(&keyboard->state_keysyms_raw, |
277 | config->current_mode->keysym_bindings, &binding_pressed, | 276 | config->current_mode->keysym_bindings, &binding, |
278 | raw_modifiers, false, input_inhibited); | 277 | raw_modifiers, false, input_inhibited); |
279 | 278 | ||
280 | if (binding_pressed) { | 279 | if (binding) { |
281 | if ((binding_pressed->flags & BINDING_RELOAD) == 0) { | 280 | seat_execute_command(seat, binding); |
282 | next_repeat_binding = binding_pressed; | ||
283 | } | ||
284 | seat_execute_command(seat, binding_pressed); | ||
285 | handled = true; | 281 | handled = true; |
286 | } | 282 | } |
287 | } | 283 | } |
288 | 284 | ||
289 | // Set up (or clear) keyboard repeat for a pressed binding | 285 | // Set up (or clear) keyboard repeat for a pressed binding |
290 | if (next_repeat_binding && wlr_device->keyboard->repeat_info.delay > 0) { | 286 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { |
291 | keyboard->repeat_binding = next_repeat_binding; | 287 | keyboard->repeat_binding = binding; |
292 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 288 | if (wl_event_source_timer_update(keyboard->key_repeat_source, |
293 | wlr_device->keyboard->repeat_info.delay) < 0) { | 289 | wlr_device->keyboard->repeat_info.delay) < 0) { |
294 | wlr_log(WLR_DEBUG, "failed to set key repeat timer"); | 290 | wlr_log(WLR_DEBUG, "failed to set key repeat timer"); |