Linux: Move to evdev for joystick input

Closes #1005.
This commit is contained in:
Anthony Pesch
2017-05-06 16:34:56 -04:00
committed by Camilla Löwy
parent 78666204a1
commit d1a2ec4d20
2 changed files with 143 additions and 30 deletions
+12 -5
View File
@@ -24,27 +24,34 @@
//
//========================================================================
#include <linux/input.h>
#include <linux/limits.h>
#include <regex.h>
#define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickLinux linjs
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs
#define HATS_MAX ((ABS_HAT3Y - ABS_HAT0X) / 2)
// Linux-specific joystick data
//
typedef struct _GLFWjoystickLinux
{
int fd;
char* path;
int fd;
char path[PATH_MAX];
int keyMap[KEY_MAX];
int absMap[ABS_MAX];
struct input_absinfo absInfo[ABS_MAX];
int hats[HATS_MAX][2];
} _GLFWjoystickLinux;
// Linux-specific joystick API data
//
typedef struct _GLFWlibraryLinux
{
int inotify;
int watch;
regex_t regex;
int inotify;
int watch;
regex_t regex;
} _GLFWlibraryLinux;