From 82cff9d923b187a3d30ab01e5a647e3c750dba55 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 17 Jul 2020 01:23:08 +0200 Subject: [PATCH] Ignore text events for shortcuts Pressing Alt+c generates a text event containing "c", so "c" was sent to the device when --prefer-text was enabled. Ignore text events when the mod state matches a shortcut modifier. --- app/src/input_manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/input_manager.c b/app/src/input_manager.c index b954fbd929..78cf19a70b 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -269,6 +269,10 @@ rotate_client_right(struct screen *screen) { void input_manager_process_text_input(struct input_manager *im, const SDL_TextInputEvent *event) { + if (is_shortcut_mod(im, SDL_GetModState())) { + // A shortcut must never generate text events + return; + } if (!im->prefer_text) { char c = event->text[0]; if (isalpha(c) || c == ' ') {