Treat any key device as a keyboard
authorSam Lantinga <slouken@libsdl.org>
Sat, 13 Dec 2014 13:20:19 -0800
changeset 92762b2cfda26085
parent 9275 a40415296b77
child 9277 f0bd40782fc7
Treat any key device as a keyboard
This matches commit b8e85a5ac99a for when udev is not running
src/core/linux/SDL_udev.c
     1.1 --- a/src/core/linux/SDL_udev.c	Fri Dec 12 21:51:30 2014 +0100
     1.2 +++ b/src/core/linux/SDL_udev.c	Sat Dec 13 13:20:19 2014 -0800
     1.3 @@ -371,10 +371,10 @@
     1.4          devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
     1.5      }
     1.6  
     1.7 -    /* the first 32 bits are ESC, numbers, and Q to D; if we have all of
     1.8 -     * those, consider it a full keyboard; do not test KEY_RESERVED, though */
     1.9 +    /* the first 32 bits are ESC, numbers, and Q to D; if we have any of
    1.10 +     * those, consider it a keyboard device; do not test KEY_RESERVED, though */
    1.11      keyboard_mask = 0xFFFFFFFE;
    1.12 -    if ((bitmask_key[0] & keyboard_mask) == keyboard_mask)
    1.13 +    if ((bitmask_key[0] & keyboard_mask) != 0)
    1.14          devclass |= SDL_UDEV_DEVICE_KEYBOARD; /* ID_INPUT_KEYBOARD */
    1.15  
    1.16      return devclass;