From a0269385473f0a3ee3d829aee4be86df9a6b8a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 1 Aug 2020 15:39:25 +0200 Subject: [PATCH] input: don't hide cursor if key is 'shift' Since shift is used to enable selecting text in mouse-grabbing applications, hiding the cursor in this case is counter productive. --- input.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/input.c b/input.c index 0d501dcb..9ea08906 100644 --- a/input.c +++ b/input.c @@ -696,15 +696,17 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, return; } - if (state == XKB_KEY_DOWN && term->conf->cursor.hide_when_typing) { - seat->pointer.hidden = true; - term_xcursor_update_for_seat(term, seat); - } - key += 8; bool should_repeat = xkb_keymap_key_repeats(seat->kbd.xkb_keymap, key); xkb_keysym_t sym = xkb_state_key_get_one_sym(seat->kbd.xkb_state, key); + if (state == XKB_KEY_DOWN && term->conf->cursor.hide_when_typing && + sym != XKB_KEY_Shift_L && sym != XKB_KEY_Shift_R) + { + seat->pointer.hidden = true; + term_xcursor_update_for_seat(term, seat); + } + #if 0 char foo[100]; xkb_keysym_get_name(sym, foo, sizeof(foo));