mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 15:30:50 +00:00
udev: Factor out SDL_EVDEV_GuessDeviceClass
This works on capability bitfields that can either come from udev or from ioctls, so it is equally applicable to both udev and non-udev input device detection. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
13e7d1a958
commit
8db3171b98
10 changed files with 153 additions and 69 deletions
|
@ -78,6 +78,7 @@
|
|||
#define BTN_DPAD_RIGHT 0x223
|
||||
#endif
|
||||
|
||||
#include "../../core/linux/SDL_evdev_capabilities.h"
|
||||
#include "../../core/linux/SDL_udev.h"
|
||||
|
||||
#if 0
|
||||
|
@ -124,10 +125,6 @@ static int numjoysticks = 0;
|
|||
static Uint32 last_joy_detect_time;
|
||||
static time_t last_input_dir_mtime;
|
||||
|
||||
#define test_bit(nr, addr) \
|
||||
(((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0)
|
||||
#define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1)
|
||||
|
||||
static void
|
||||
FixupDeviceInfoForMapping(int fd, struct input_id *inpid)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue