aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-10 15:24:31 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-10 15:24:31 +0100
commitb491c48785b55cc841e11c3f13f307c0d4cc0ef7 (patch)
treefe58c576b7e23305a20ec24b59c087ec87109877
parentall: rig up Hare-native error handling (diff)
downloadhare-chip8-b491c48785b55cc841e11c3f13f307c0d4cc0ef7.tar.gz
gamecontroller: add button enum
-rw-r--r--sdl2/gamecontroller.ha26
1 files changed, 26 insertions, 0 deletions
diff --git a/sdl2/gamecontroller.ha b/sdl2/gamecontroller.ha
index cf78674..46b5f5c 100644
--- a/sdl2/gamecontroller.ha
+++ b/sdl2/gamecontroller.ha
@@ -22,6 +22,32 @@ export type controller_axis = enum u8 {
INVALID = 255,
};
+// The list of buttons available from a controller
+export type controller_button = enum u8 {
+ INVALID = 255,
+ A = 0,
+ B,
+ X,
+ Y,
+ BACK,
+ GUIDE,
+ START,
+ LEFTSTICK,
+ RIGHTSTICK,
+ LEFTSHOULDER,
+ RIGHTSHOULDER,
+ DPAD_UP,
+ DPAD_DOWN,
+ DPAD_LEFT,
+ DPAD_RIGHT,
+ MISC1,
+ PADDLE1,
+ PADDLE2,
+ PADDLE3,
+ PADDLE4,
+ TOUCHPAD,
+};
+
// Check if the given joystick is supported by the game controller interface.
//
// 'joystick_index' is the same as the 'device_index' passed to