From 96578aa91e9856bfb3e2d26fb7a625ff7c9b79e3 Mon Sep 17 00:00:00 2001 From: Tamir Zahavi-Brunner Date: Mon, 7 Sep 2020 01:44:13 +0300 Subject: hide_cursor: Add an option to hide when typing Add an option for the `hide_cursor` command to hide the cursor when typing, i.e. whenever a key is pressed. --- sway/input/keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sway/input/keyboard.c') diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 541fc90d..ae30e83a 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -13,6 +13,7 @@ #include "sway/input/input-manager.h" #include "sway/input/keyboard.h" #include "sway/input/seat.h" +#include "sway/input/cursor.h" #include "sway/ipc-server.h" #include "log.h" @@ -392,6 +393,10 @@ static void handle_key_event(struct sway_keyboard *keyboard, keyboard_shortcuts_inhibitor_get_for_focused_surface(seat); bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active; + if (event->state == WLR_KEY_PRESSED) { + cursor_notify_key_press(seat->cursor); + } + // Identify new keycode, raw keysym(s), and translated keysym(s) struct key_info keyinfo; update_keyboard_state(keyboard, event->keycode, event->state, &keyinfo); -- cgit v1.2.3-54-g00ecf