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.
This commit is contained in:
Tamir Zahavi-Brunner 2020-09-07 01:44:13 +03:00 committed by Simon Ser
parent 4799cb0960
commit 96578aa91e
7 changed files with 91 additions and 15 deletions

View file

@ -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);