evdev: don't debug log on a BTN_TOUCH from a non-touch device.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 14 Jan 2019 19:43:25 -0500
changeset 125481ae839748d02
parent 12547 f100ca4dd31e
child 12549 787e86a461f5
evdev: don't debug log on a BTN_TOUCH from a non-touch device.
src/core/linux/SDL_evdev.c
     1.1 --- a/src/core/linux/SDL_evdev.c	Mon Jan 14 19:36:54 2019 -0500
     1.2 +++ b/src/core/linux/SDL_evdev.c	Mon Jan 14 19:43:25 2019 -0500
     1.3 @@ -448,9 +448,15 @@
     1.4          scancode = linux_scancode_table[keycode];
     1.5  
     1.6      if (scancode == SDL_SCANCODE_UNKNOWN) {
     1.7 -        SDL_Log("The key you just pressed is not recognized by SDL. To help "
     1.8 -            "get this fixed, please report this to the SDL forums/mailing list "
     1.9 -            "<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
    1.10 +        /* BTN_TOUCH is handled elsewhere, but we might still end up here if
    1.11 +           you get an unexpected BTN_TOUCH from something SDL believes is not
    1.12 +           a touch device. In this case, we'd rather not get a misleading
    1.13 +           SDL_Log message about an unknown key. */
    1.14 +        if (keycode != BTN_TOUCH) {
    1.15 +            SDL_Log("The key you just pressed is not recognized by SDL. To help "
    1.16 +                "get this fixed, please report this to the SDL forums/mailing list "
    1.17 +                "<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
    1.18 +        }
    1.19      }
    1.20  
    1.21      return scancode;