evdev: don't debug log on a BTN_TOUCH from a non-touch device.

This commit is contained in:
Ryan C. Gordon 2019-01-14 19:43:25 -05:00
parent 2755a505a3
commit 861a21f98b
1 changed files with 9 additions and 3 deletions

View File

@ -448,9 +448,15 @@ SDL_EVDEV_translate_keycode(int keycode)
scancode = linux_scancode_table[keycode]; scancode = linux_scancode_table[keycode];
if (scancode == SDL_SCANCODE_UNKNOWN) { if (scancode == SDL_SCANCODE_UNKNOWN) {
SDL_Log("The key you just pressed is not recognized by SDL. To help " /* BTN_TOUCH is handled elsewhere, but we might still end up here if
"get this fixed, please report this to the SDL forums/mailing list " you get an unexpected BTN_TOUCH from something SDL believes is not
"<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode); 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 "
"<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
}
} }
return scancode; return scancode;