Skip to content

Commit

Permalink
Ignore text events for shortcuts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rom1v committed Jul 17, 2020
1 parent 060d91e commit 7bfff97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == ' ') {
Expand Down

0 comments on commit 7bfff97

Please sign in to comment.