Skip to content

Commit

Permalink
Treat any key device as a keyboard
Browse files Browse the repository at this point in the history
This matches commit d325f1bbbab4 for when udev is not running
  • Loading branch information
slouken committed Dec 13, 2014
1 parent b970773 commit 708a43f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/linux/SDL_udev.c
Expand Up @@ -371,10 +371,10 @@ guess_device_class(struct udev_device *dev)
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;
Expand Down

0 comments on commit 708a43f

Please sign in to comment.