28#ifndef SDL_gamecontroller_h_
29#define SDL_gamecontroller_h_
58struct _SDL_GameController;
59typedef struct _SDL_GameController SDL_GameController;
63 SDL_CONTROLLER_TYPE_UNKNOWN = 0,
64 SDL_CONTROLLER_TYPE_XBOX360,
65 SDL_CONTROLLER_TYPE_XBOXONE,
66 SDL_CONTROLLER_TYPE_PS3,
67 SDL_CONTROLLER_TYPE_PS4,
68 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
69 SDL_CONTROLLER_TYPE_VIRTUAL,
70 SDL_CONTROLLER_TYPE_PS5,
71 SDL_CONTROLLER_TYPE_AMAZON_LUNA,
72 SDL_CONTROLLER_TYPE_GOOGLE_STADIA,
73 SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
74 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
75 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
76 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
77} SDL_GameControllerType;
81 SDL_CONTROLLER_BINDTYPE_NONE = 0,
82 SDL_CONTROLLER_BINDTYPE_BUTTON,
83 SDL_CONTROLLER_BINDTYPE_AXIS,
84 SDL_CONTROLLER_BINDTYPE_HAT
85} SDL_GameControllerBindType;
92 SDL_GameControllerBindType bindType;
172#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
605 SDL_CONTROLLER_AXIS_INVALID = -1,
606 SDL_CONTROLLER_AXIS_LEFTX,
607 SDL_CONTROLLER_AXIS_LEFTY,
608 SDL_CONTROLLER_AXIS_RIGHTX,
609 SDL_CONTROLLER_AXIS_RIGHTY,
610 SDL_CONTROLLER_AXIS_TRIGGERLEFT,
611 SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
612 SDL_CONTROLLER_AXIS_MAX
682extern DECLSPEC SDL_bool SDLCALL
702extern DECLSPEC Sint16 SDLCALL
710 SDL_CONTROLLER_BUTTON_INVALID = -1,
711 SDL_CONTROLLER_BUTTON_A,
712 SDL_CONTROLLER_BUTTON_B,
713 SDL_CONTROLLER_BUTTON_X,
714 SDL_CONTROLLER_BUTTON_Y,
715 SDL_CONTROLLER_BUTTON_BACK,
716 SDL_CONTROLLER_BUTTON_GUIDE,
717 SDL_CONTROLLER_BUTTON_START,
718 SDL_CONTROLLER_BUTTON_LEFTSTICK,
719 SDL_CONTROLLER_BUTTON_RIGHTSTICK,
720 SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
721 SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
722 SDL_CONTROLLER_BUTTON_DPAD_UP,
723 SDL_CONTROLLER_BUTTON_DPAD_DOWN,
724 SDL_CONTROLLER_BUTTON_DPAD_LEFT,
725 SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
726 SDL_CONTROLLER_BUTTON_MISC1,
727 SDL_CONTROLLER_BUTTON_PADDLE1,
728 SDL_CONTROLLER_BUTTON_PADDLE2,
729 SDL_CONTROLLER_BUTTON_PADDLE3,
730 SDL_CONTROLLER_BUTTON_PADDLE4,
731 SDL_CONTROLLER_BUTTON_TOUCHPAD,
732 SDL_CONTROLLER_BUTTON_MAX
935extern DECLSPEC
int SDLCALL
SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
DECLSPEC Sint16 SDLCALL SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC const char *SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button)
DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller)
DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index)
DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size)
DECLSPEC const char *SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index)
DECLSPEC int SDLCALL SDL_GameControllerEventState(int state)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index)
DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure)
DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue)
DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str)
DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char *mappingString)
DECLSPEC const char *SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad)
DECLSPEC const char *SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller)
DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)
DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type)
DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index)
DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index)
DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *str)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values)
DECLSPEC void SDLCALL SDL_GameControllerUpdate(void)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)
SDL_GameControllerAxis
Definition: SDL_gamecontroller.h:604
DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
SDL_GameControllerButton
Definition: SDL_gamecontroller.h:709
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller)
DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller)
DECLSPEC char *SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void)
DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)
DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled)
DECLSPEC const char *SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForIndex(int mapping_index)
DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index)
DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type)
DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
Sint32 SDL_JoystickID
Definition: SDL_joystick.h:82
SDL_SensorType
Definition: SDL_sensor.h:70
Definition: SDL_guid.h:55
Definition: SDL_rwops.h:53