28 #ifndef SDL_gamecontroller_h_
29 #define SDL_gamecontroller_h_
58 struct _SDL_GameController;
59 typedef 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_GameControllerType;
75 SDL_CONTROLLER_BINDTYPE_NONE = 0,
76 SDL_CONTROLLER_BINDTYPE_BUTTON,
77 SDL_CONTROLLER_BINDTYPE_AXIS,
78 SDL_CONTROLLER_BINDTYPE_HAT
79 } SDL_GameControllerBindType;
86 SDL_GameControllerBindType bindType;
141 #define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
314 SDL_CONTROLLER_AXIS_INVALID = -1,
315 SDL_CONTROLLER_AXIS_LEFTX,
316 SDL_CONTROLLER_AXIS_LEFTY,
317 SDL_CONTROLLER_AXIS_RIGHTX,
318 SDL_CONTROLLER_AXIS_RIGHTY,
319 SDL_CONTROLLER_AXIS_TRIGGERLEFT,
320 SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
321 SDL_CONTROLLER_AXIS_MAX
344 extern DECLSPEC SDL_bool SDLCALL
355 extern DECLSPEC Sint16 SDLCALL
363 SDL_CONTROLLER_BUTTON_INVALID = -1,
364 SDL_CONTROLLER_BUTTON_A,
365 SDL_CONTROLLER_BUTTON_B,
366 SDL_CONTROLLER_BUTTON_X,
367 SDL_CONTROLLER_BUTTON_Y,
368 SDL_CONTROLLER_BUTTON_BACK,
369 SDL_CONTROLLER_BUTTON_GUIDE,
370 SDL_CONTROLLER_BUTTON_START,
371 SDL_CONTROLLER_BUTTON_LEFTSTICK,
372 SDL_CONTROLLER_BUTTON_RIGHTSTICK,
373 SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
374 SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
375 SDL_CONTROLLER_BUTTON_DPAD_UP,
376 SDL_CONTROLLER_BUTTON_DPAD_DOWN,
377 SDL_CONTROLLER_BUTTON_DPAD_LEFT,
378 SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
379 SDL_CONTROLLER_BUTTON_MISC1,
380 SDL_CONTROLLER_BUTTON_PADDLE1,
381 SDL_CONTROLLER_BUTTON_PADDLE2,
382 SDL_CONTROLLER_BUTTON_PADDLE3,
383 SDL_CONTROLLER_BUTTON_PADDLE4,
384 SDL_CONTROLLER_BUTTON_TOUCHPAD,
385 SDL_CONTROLLER_BUTTON_MAX
491 extern 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 Sint16 SDLCALL SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
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 char *SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index)
DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString)
DECLSPEC int SDLCALL SDL_GameControllerEventState(int state)
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 const char *SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button)
DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue)
DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char *mappingString)
DECLSPEC const char *SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
DECLSPEC char *SDLCALL SDL_GameControllerMapping(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_GameControllerGetSerial(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)
DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
DECLSPEC void SDLCALL SDL_GameControllerUpdate(void)
SDL_GameControllerAxis
Definition: SDL_gamecontroller.h:313
DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller)
DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)
SDL_GameControllerButton
Definition: SDL_gamecontroller.h:362
DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index)
DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller)
DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
struct SDL_GameControllerButtonBind SDL_GameControllerButtonBind
DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void)
DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index)
DECLSPEC char *SDLCALL SDL_GameControllerMappingForIndex(int mapping_index)
DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index)
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_GameControllerName(SDL_GameController *gamecontroller)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString)
DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller)
DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)
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:81
SDL_SensorType
Definition: SDL_sensor.h:70
Definition: SDL_joystick.h:70
Definition: SDL_rwops.h:53