Skip to content

Commit

Permalink
evdev: Don't warn on unknown scancode
Browse files Browse the repository at this point in the history
In our case, this warning appears all the time but the keys are still
perfectly recognized.
  • Loading branch information
pcercuei authored and glebm committed Mar 26, 2021
1 parent 4ddd81b commit ddb1671
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/core/linux/SDL_evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,22 +446,9 @@ SDL_EVDEV_translate_keycode(int keycode)
{
SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;

if (keycode < SDL_arraysize(linux_scancode_table)) {
if (keycode < SDL_arraysize(linux_scancode_table))
scancode = linux_scancode_table[keycode];

if (scancode == SDL_SCANCODE_UNKNOWN) {
/* 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 "
"<https://discourse.libsdl.org/> EVDEV KeyCode %d", keycode);
}
}
}

return scancode;
}

Expand Down

0 comments on commit ddb1671

Please sign in to comment.