Skip to content

Commit

Permalink
[unix/joystick] support ancient linuxen
Browse files Browse the repository at this point in the history
RHEL7 still has support somewhere but is oooold.
  • Loading branch information
krono committed Jun 14, 2022
1 parent 1964ef3 commit d9d9f32
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions platforms/unix/plugins/JoystickTabletPlugin/sqUnixJoystickTablet.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

/* Author: [email protected]
/* Author: [email protected]
* Author: [email protected]
*/

#include <assert.h>
Expand All @@ -42,8 +42,24 @@
#include <dirent.h>
#include <errno.h>
#include <poll.h>
#include <linux/input-event-codes.h>
#include <linux/input.h>
/*
* For compatibility with olden linuxen <=3.10*
*/
#if !defined(BTN_NORTH) && defined(BTN_X)
#define BTN_NORTH BTN_X
#endif
#if !defined(BTN_EAST) && defined(BTN_B)
#define BTN_EAST BTN_B
#endif
#if !defined(BTN_SOUTH) && defined(BTN_A)
#define BTN_SOUTH BTN_A
#endif
#if !defined(BTN_WEST) && defined(BTN_Y)
#define BTN_WEST BTN_Y
#endif


#include "JoystickTabletPlugin.h"

#define DEVICE_DIR "/dev/input/by-id/"
Expand Down Expand Up @@ -329,6 +345,8 @@ joystickShutdown(void)
}

joystick_count = 0;

return 1;
}


Expand Down

0 comments on commit d9d9f32

Please sign in to comment.