summaryrefslogtreecommitdiff
path: root/global_defs.h
diff options
context:
space:
mode:
authorClay Smith <claysmith158@gmail.com>2023-01-26 03:48:38 -0600
committerClay Smith <claysmith158@gmail.com>2023-01-26 03:48:38 -0600
commitd83a049ca7556ebc0a03f7f66dd7f89b0b2a72e5 (patch)
tree6a44481570ad95316096f60d01f35af5381412bf /global_defs.h
First Commit
Diffstat (limited to 'global_defs.h')
-rw-r--r--global_defs.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/global_defs.h b/global_defs.h
new file mode 100644
index 0000000..17269c9
--- /dev/null
+++ b/global_defs.h
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <linux/input.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+//magic numbers
+#define NUM_EVENTS 12 //steam + xbox + ps4 * 6 + wii * 3 + mouse
+#define NUM_EVENTS_WII_PS4 3
+
+#define PS4_BT_TOUCH_BIT 32
+#define PS4_BT_GYRO_BIT 64
+#define PS4_BT_BUTTONS_BIT 128
+#define PS4_BT_ALL_BITS 224 // 128 + 64 + 32
+
+#define PS4_WIRED_TOUCH_BIT 4
+#define PS4_WIRED_GYRO_BIT 8
+#define PS4_WIRED_BUTTONS_BIT 16
+#define PS4_WIRED_ALL_BITS 28 // 16 + 8 + 4
+
+#define NINTENDO_GYRO_BIT 256
+#define NINTENDO_IR_BIT 512
+#define NINTENDO_BUTTONS_BIT 1024
+#define NINTENDO_ALL_BITS 1792 // 1024 + 512 + 256
+
+enum {
+ IR = 0, TOUCHPAD = 0, GYRO = 1, BUTTONS = 2
+};
+
+enum {
+ VALVE_STEAM = 0,
+ XBOX_360 = 1,
+ PS4_WIRED_GYRO = 2, PS4_WIRED_BUTTONS = 3, PS4_WIRED_TOUCH = 4,
+ PS4_BT_GYRO = 5, PS4_BT_BUTTONS = 6, PS4_BT_TOUCH = 7,
+ WII_GYRO = 8, WII_IR = 9, WII_BUTTONS = 10, MOUSE = 11
+};
+