From b491c48785b55cc841e11c3f13f307c0d4cc0ef7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 10 Dec 2021 15:24:31 +0100 Subject: gamecontroller: add button enum --- sdl2/gamecontroller.ha | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'sdl2') 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 -- cgit v1.2.3