diff options
| author | Drew DeVault <sir@cmpwn.com> | 2021-12-10 15:24:31 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2021-12-10 15:24:31 +0100 |
| commit | b491c48785b55cc841e11c3f13f307c0d4cc0ef7 (patch) | |
| tree | fe58c576b7e23305a20ec24b59c087ec87109877 | |
| parent | all: rig up Hare-native error handling (diff) | |
| download | hare-chip8-b491c48785b55cc841e11c3f13f307c0d4cc0ef7.tar.gz | |
gamecontroller: add button enum
| -rw-r--r-- | sdl2/gamecontroller.ha | 26 |
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 |
