Updated Linux joystick code to support hotplug, GUIDs, etc.
This uses libudev for hotplug, but it's optional, so we'll just try to find some reasonable defaults without it (maybe an older Linux box or under FreeBSD's Linux emulation?).
This commit is contained in:
parent
41a157a462
commit
c8713a62c1
6 changed files with 537 additions and 152 deletions
|
@ -19,14 +19,16 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#if SDL_INPUT_LINUXEV
|
||||
#include <linux/input.h>
|
||||
#endif
|
||||
|
||||
/* The private structure used to keep track of a joystick */
|
||||
struct joystick_hwdata
|
||||
{
|
||||
int fd;
|
||||
int device_instance;
|
||||
SDL_bool removed;
|
||||
|
||||
JoystickGUID guid;
|
||||
char *fname; /* Used in haptic subsystem */
|
||||
|
||||
/* The current linux joystick driver maps hats to two axes */
|
||||
|
@ -41,8 +43,6 @@ struct joystick_hwdata
|
|||
} *balls;
|
||||
|
||||
/* Support for the Linux 2.4 unified input interface */
|
||||
#if SDL_INPUT_LINUXEV
|
||||
SDL_bool is_hid;
|
||||
Uint8 key_map[KEY_MAX - BTN_MISC];
|
||||
Uint8 abs_map[ABS_MAX];
|
||||
struct axis_correct
|
||||
|
@ -50,5 +50,4 @@ struct joystick_hwdata
|
|||
int used;
|
||||
int coef[3];
|
||||
} abs_correct[ABS_MAX];
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue