aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/keyboard.c13
-rw-r--r--sway/input/seat.c6
2 files changed, 13 insertions, 6 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index c1b53237..46286410 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -295,14 +295,10 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
get_active_binding(&keyboard->state_keysyms_raw,
config->current_mode->keysym_bindings, &binding,
raw_modifiers, false, input_inhibited, device_identifier);
-
- if (binding) {
- seat_execute_command(seat, binding);
- handled = true;
- }
}
- // Set up (or clear) keyboard repeat for a pressed binding
+ // Set up (or clear) keyboard repeat for a pressed binding. Since the
+ // binding may remove the keyboard, the timer needs to be updated first
if (binding && wlr_device->keyboard->repeat_info.delay > 0) {
keyboard->repeat_binding = binding;
if (wl_event_source_timer_update(keyboard->key_repeat_source,
@@ -316,6 +312,11 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
}
}
+ if (binding) {
+ seat_execute_command(seat, binding);
+ handled = true;
+ }
+
// Compositor bindings
if (!handled && event->state == WLR_KEY_PRESSED) {
handled = keyboard_execute_compositor_binding(
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 52790039..41a3a4df 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -428,6 +428,12 @@ static void seat_apply_input_config(struct sway_seat *seat,
if (mapped_to_output != NULL) {
wlr_log(WLR_DEBUG, "Mapping input device %s to output %s",
sway_device->input_device->identifier, mapped_to_output);
+ if (strcmp("*", mapped_to_output) == 0) {
+ wlr_cursor_map_input_to_output(seat->cursor->cursor,
+ sway_device->input_device->wlr_device, NULL);
+ wlr_log(WLR_DEBUG, "Reset output mapping");
+ return;
+ }
struct sway_output *output = output_by_name_or_id(mapped_to_output);
if (output) {
wlr_cursor_map_input_to_output(seat->cursor->cursor,