From 861a21f98b7c8bdd779c0949e5ec067bfefc5ec6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 14 Jan 2019 19:43:25 -0500 Subject: [PATCH] evdev: don't debug log on a BTN_TOUCH from a non-touch device. --- src/core/linux/SDL_evdev.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index e5577716be487..d0f9341da7154 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -448,9 +448,15 @@ SDL_EVDEV_translate_keycode(int keycode) scancode = linux_scancode_table[keycode]; if (scancode == SDL_SCANCODE_UNKNOWN) { - SDL_Log("The key you just pressed is not recognized by SDL. To help " - "get this fixed, please report this to the SDL forums/mailing list " - " EVDEV KeyCode %d", keycode); + /* BTN_TOUCH is handled elsewhere, but we might still end up here if + you get an unexpected BTN_TOUCH from something SDL believes is not + a touch device. In this case, we'd rather not get a misleading + SDL_Log message about an unknown key. */ + if (keycode != BTN_TOUCH) { + SDL_Log("The key you just pressed is not recognized by SDL. To help " + "get this fixed, please report this to the SDL forums/mailing list " + " EVDEV KeyCode %d", keycode); + } } return scancode;