Treat any key device as a keyboard
authorSam Lantinga <slouken@libsdl.org>
Sat, 13 Dec 2014 13:20:19 -0800
changeset 9276 2b2cfda26085
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
--- a/src/core/linux/SDL_udev.c	Fri Dec 12 21:51:30 2014 +0100
+++ b/src/core/linux/SDL_udev.c	Sat Dec 13 13:20:19 2014 -0800
@@ -371,10 +371,10 @@
         devclass |= SDL_UDEV_DEVICE_MOUSE; /* ID_INPUT_MOUSE */
     }
 
-    /* the first 32 bits are ESC, numbers, and Q to D; if we have all of
-     * those, consider it a full keyboard; do not test KEY_RESERVED, though */
+    /* the first 32 bits are ESC, numbers, and Q to D; if we have any of
+     * those, consider it a keyboard device; do not test KEY_RESERVED, though */
     keyboard_mask = 0xFFFFFFFE;
-    if ((bitmask_key[0] & keyboard_mask) == keyboard_mask)
+    if ((bitmask_key[0] & keyboard_mask) != 0)
         devclass |= SDL_UDEV_DEVICE_KEYBOARD; /* ID_INPUT_KEYBOARD */
 
     return devclass;