Go to the documentation of this file.
21 #include "../SDL_internal.h"
32 #if !SDL_EVENTS_DISABLED
33 #include "../events/SDL_events_c.h"
35 #include "../video/SDL_sysvideo.h"
43 #include "../core/windows/SDL_windows.h"
50 #if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT)
53 #ifdef SDL_JOYSTICK_LINUX
56 #ifdef SDL_JOYSTICK_IOKIT
59 #if defined(__IPHONEOS__) || defined(__TVOS__)
62 #ifdef SDL_JOYSTICK_ANDROID
65 #ifdef SDL_JOYSTICK_EMSCRIPTEN
68 #ifdef SDL_JOYSTICK_HAIKU
71 #ifdef SDL_JOYSTICK_USBHID
74 #ifdef SDL_JOYSTICK_HIDAPI
77 #if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
149 int existing_player_index;
151 if (player_index < 0) {
171 if (existing_player_index >= 0) {
184 if (existing_instance >= 0) {
193 if (hint && *hint ==
'1') {
216 #if !SDL_EVENTS_DISABLED
237 int i, total_joysticks = 0;
243 return total_joysticks;
262 int i, num_joysticks, total_joysticks = 0;
264 if (device_index >= 0) {
267 if (device_index < num_joysticks) {
269 *driver_index = device_index;
272 device_index -= num_joysticks;
273 total_joysticks += num_joysticks;
277 SDL_SetError(
"There are %d joysticks available", total_joysticks);
288 const char *skip_prefix =
"NVIDIA Corporation ";
340 static Uint32 zero_centered_joysticks[] = {
357 if (
id == zero_centered_joysticks[
i]) {
377 SDL_Joystick *joysticklist;
378 const char *joystickname =
NULL;
392 while (joysticklist) {
393 if (instance_id == joysticklist->instance_id) {
399 joysticklist = joysticklist->next;
410 joystick->instance_id = instance_id;
436 joystick->balls = (
struct balldelta *)
SDL_calloc(joystick->nballs,
sizeof(*joystick->balls));
438 if (joystick->nbuttons > 0) {
441 if (((joystick->naxes > 0) && !joystick->axes)
442 || ((joystick->nhats > 0) && !joystick->hats)
443 || ((joystick->nballs > 0) && !joystick->balls)
444 || ((joystick->nbuttons > 0) && !joystick->buttons)) {
455 for (
i = 0;
i < joystick->naxes; ++
i) {
456 joystick->axes[
i].has_initial_value =
SDL_TRUE;
463 ++joystick->ref_count;
484 if (joystick ==
NULL) {
503 return joystick->naxes;
515 return joystick->nhats;
527 return joystick->nballs;
539 return joystick->nbuttons;
553 if (axis < joystick->naxes) {
556 SDL_SetError(
"Joystick only has %d axes", joystick->naxes);
571 if (
axis >= joystick->naxes) {
572 SDL_SetError(
"Joystick only has %d axes", joystick->naxes);
576 *
state = joystick->axes[
axis].initial_value;
578 return joystick->axes[
axis].has_initial_value;
592 if (hat < joystick->nhats) {
593 state = joystick->hats[hat];
595 SDL_SetError(
"Joystick only has %d hats", joystick->nhats);
614 if (ball < joystick->nballs) {
616 *dx = joystick->balls[ball].dx;
619 *dy = joystick->balls[ball].dy;
621 joystick->balls[ball].dx = 0;
622 joystick->balls[ball].dy = 0;
624 return SDL_SetError(
"Joystick only has %d balls", joystick->nballs);
640 if (button < joystick->nbuttons) {
643 SDL_SetError(
"Joystick only has %d buttons", joystick->nbuttons);
660 return joystick->attached;
673 return joystick->instance_id;
682 SDL_Joystick *joystick;
685 for (joystick =
SDL_joysticks; joystick; joystick = joystick->next) {
686 if (joystick->instance_id == instance_id) {
701 SDL_Joystick *joystick;
705 for (joystick =
SDL_joysticks; joystick; joystick = joystick->next) {
706 if (joystick->instance_id == instance_id) {
771 if (low_frequency_rumble == joystick->low_frequency_rumble &&
772 high_frequency_rumble == joystick->high_frequency_rumble) {
776 result = joystick->driver->Rumble(joystick, low_frequency_rumble, high_frequency_rumble);
780 joystick->low_frequency_rumble = low_frequency_rumble;
781 joystick->high_frequency_rumble = high_frequency_rumble;
783 if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
785 if (!joystick->rumble_expiration) {
786 joystick->rumble_expiration = 1;
789 joystick->rumble_expiration = 0;
802 SDL_Joystick *joysticklist;
803 SDL_Joystick *joysticklistprev;
812 if (--joystick->ref_count > 0) {
822 if (joystick->rumble_expiration) {
826 joystick->driver->Close(joystick);
827 joystick->hwdata =
NULL;
830 joysticklistprev =
NULL;
831 while (joysticklist) {
832 if (joystick == joysticklist) {
833 if (joysticklistprev) {
835 joysticklistprev->next = joysticklist->next;
841 joysticklistprev = joysticklist;
842 joysticklist = joysticklist->next;
888 #if !SDL_EVENTS_DISABLED
924 int driver_device_index;
925 int player_index = -1;
927 if (device_index < 0) {
938 if (player_index >= 0) {
943 #if !SDL_EVENTS_DISABLED
950 event.jdevice.which = device_index;
969 if (num_events <= 0) {
979 for (
i = 0;
i < num_events; ++
i) {
989 SDL_Joystick *joystick;
992 #if !SDL_EVENTS_DISABLED
998 event.jdevice.which = device_instance;
1006 for (joystick =
SDL_joysticks; joystick; joystick = joystick->next) {
1007 if (joystick->instance_id == device_instance) {
1009 joystick->force_recentering =
SDL_TRUE;
1016 if (player_index >= 0) {
1029 if (
axis >= joystick->naxes) {
1033 info = &joystick->axes[
axis];
1072 #if !SDL_EVENTS_DISABLED
1076 event.jaxis.which = joystick->instance_id;
1077 event.jaxis.axis =
axis;
1078 event.jaxis.value =
value;
1091 if (hat >= joystick->nhats) {
1094 if (
value == joystick->hats[hat]) {
1108 joystick->hats[hat] =
value;
1112 #if !SDL_EVENTS_DISABLED
1116 event.jhat.which = joystick->instance_id;
1117 event.jhat.hat = hat;
1118 event.jhat.value =
value;
1132 if (ball >= joystick->nballs) {
1142 joystick->balls[ball].dx += xrel;
1143 joystick->balls[ball].dy += yrel;
1147 #if !SDL_EVENTS_DISABLED
1151 event.jball.which = joystick->instance_id;
1152 event.jball.ball = ball;
1153 event.jball.xrel = xrel;
1154 event.jball.yrel = yrel;
1165 #if !SDL_EVENTS_DISABLED
1182 if (
button >= joystick->nbuttons) {
1202 #if !SDL_EVENTS_DISABLED
1204 event.jbutton.which = joystick->instance_id;
1205 event.jbutton.button =
button;
1206 event.jbutton.state =
state;
1217 SDL_Joystick *joystick, *next;
1236 #ifdef SDL_JOYSTICK_HIDAPI
1241 for (joystick =
SDL_joysticks; joystick; joystick = joystick->next) {
1242 if (joystick->attached) {
1244 if (joystick->driver) {
1245 joystick->driver->Update(joystick);
1248 if (joystick->delayed_guide_button) {
1253 if (joystick->rumble_expiration) {
1256 if (joystick->rumble_expiration &&
1263 if (joystick->force_recentering) {
1265 for (
i = 0;
i < joystick->naxes;
i++) {
1266 if (joystick->axes[
i].has_initial_value) {
1271 for (
i = 0;
i < joystick->nbuttons;
i++) {
1275 for (
i = 0;
i < joystick->nhats;
i++) {
1279 joystick->force_recentering =
SDL_FALSE;
1289 next = joystick->next;
1290 if (joystick->ref_count <= 0) {
1308 #if SDL_EVENTS_DISABLED
1311 const Uint32 event_list[] = {
1343 guid16[1] == 0x0000 &&
1345 guid16[3] == 0x0000 &&
1351 *vendor = guid16[2];
1354 *product = guid16[4];
1357 *version = guid16[6];
1376 if (
SDL_strcmp(manufacturer,
"Performance Designed Products") == 0) {
1378 }
else if (
SDL_strcmp(manufacturer,
"HORI CO.,LTD") == 0) {
1382 return manufacturer;
1411 static const int LIBUSB_CLASS_VENDOR_SPEC = 0xFF;
1412 static const int XB360_IFACE_SUBCLASS = 93;
1413 static const int XB360_IFACE_PROTOCOL = 1;
1414 static const int XB360W_IFACE_PROTOCOL = 129;
1415 static const int XBONE_IFACE_SUBCLASS = 71;
1416 static const int XBONE_IFACE_PROTOCOL = 208;
1421 if (interface_class == LIBUSB_CLASS_VENDOR_SPEC &&
1422 interface_subclass == XB360_IFACE_SUBCLASS &&
1423 (interface_protocol == XB360_IFACE_PROTOCOL ||
1424 interface_protocol == XB360W_IFACE_PROTOCOL)) {
1426 static const int SUPPORTED_VENDORS[] = {
1452 if (vendor == SUPPORTED_VENDORS[
i]) {
1459 if (interface_number == 0 &&
1460 interface_class == LIBUSB_CLASS_VENDOR_SPEC &&
1461 interface_subclass == XBONE_IFACE_SUBCLASS &&
1462 interface_protocol == XBONE_IFACE_PROTOCOL) {
1464 static const int SUPPORTED_VENDORS[] = {
1476 if (vendor == SUPPORTED_VENDORS[
i]) {
1484 if (vendor == 0x0000 && product == 0x0000) {
1495 }
else if (vendor == 0x0001 && product == 0x0001) {
1554 static Uint32 wheel_joysticks[] = {
1572 if (vidpid == wheel_joysticks[
i]) {
1581 static Uint32 flightstick_joysticks[] = {
1588 if (vidpid == flightstick_joysticks[
i]) {
1597 static Uint32 throttle_joysticks[] = {
1604 if (vidpid == throttle_joysticks[
i]) {
1619 switch (guid.
data[15]) {
1668 const char *mapper_processes[] = {
1673 PROCESSENTRY32 pe32;
1677 HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
1678 if (hProcessSnap != INVALID_HANDLE_VALUE) {
1679 pe32.dwSize =
sizeof(PROCESSENTRY32);
1680 if (Process32First(hProcessSnap, &pe32)) {
1688 }
while (Process32Next(hProcessSnap, &pe32) && !found);
1690 CloseHandle(hProcessSnap);
1703 static Uint32 joystick_blacklist[] = {
1810 if (
id == joystick_blacklist[
i]) {
1901 int i, num_joysticks, device_index = -1;
1905 for (
i = 0;
i < num_joysticks; ++
i) {
1913 return device_index;
1923 return joystick->guid;
1960 if (joystick && joystick->is_game_controller) {
1970 static const char k_rgchHexToASCII[] =
"0123456789abcdef";
1973 if ((pszGUID ==
NULL) || (cbGUID <= 0)) {
1977 for (
i = 0;
i <
sizeof(guid.
data) &&
i < (cbGUID-1)/2;
i++) {
1980 unsigned char c = guid.
data[
i];
1982 *pszGUID++ = k_rgchHexToASCII[
c >> 4];
1983 *pszGUID++ = k_rgchHexToASCII[
c & 0x0F];
1995 if ((
c >=
'0') && (
c <=
'9')) {
1996 return (
unsigned char)(
c -
'0');
1999 if ((
c >=
'A') && (
c <=
'F')) {
2000 return (
unsigned char)(
c -
'A' + 0x0a);
2003 if ((
c >=
'a') && (
c <=
'f')) {
2004 return (
unsigned char)(
c -
'a' + 0x0a);
2016 int maxoutputbytes=
sizeof(guid);
2027 for (
i = 0; (
i <
len) && ((
p - (
Uint8 *)&guid) < maxoutputbytes);
i+=2,
p++) {
2037 joystick->epowerlevel = ePowerLevel;
2046 return joystick->epowerlevel;
int SDL_JoystickEventState(int state)
@ SDL_JOYSTICK_TYPE_GAMECONTROLLER
SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid)
@ k_eControllerType_SteamController
SDL_JoystickType SDL_JoystickGetDeviceType(int device_index)
#define SDL_MAX_RUMBLE_DURATION_MS
@ k_eControllerType_SwitchInputOnlyController
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
A variable that lets you enable joystick (and gamecontroller) events even when your app is in the bac...
const char * SDL_GetCustomJoystickName(Uint16 vendor, Uint16 product)
#define SDL_small_free(ptr, isstack)
int SDL_JoystickNumButtons(SDL_Joystick *joystick)
static SDL_INLINE EControllerType GuessControllerType(int nVID, int nPID)
#define SDL_IsGameController
void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
static SDL_bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick)
void(* SetDevicePlayerIndex)(int device_index, int player_index)
SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state)
int SDL_JoystickInit(void)
const char * SDL_JoystickNameForIndex(int device_index)
@ k_eControllerType_SwitchProController
int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id)
SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *name)
static SDL_bool SDL_IsPS4RemapperRunning(void)
#define SDL_INIT_JOYSTICK
static const char * SDL_FixupJoystickName(const char *name)
SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID)
SDL_JoystickDriver SDL_BSD_JoystickDriver
@ SDL_CONTROLLER_TYPE_UNKNOWN
static SDL_bool SDL_joystick_allows_background_events
SDL_JoystickID(* GetDeviceInstanceID)(int device_index)
static SDL_bool SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id)
#define SDL_AtomicIncRef(a)
Increment an atomic variable used as a reference count.
#define SDL_QuitSubSystem
SDL_JoyDeviceEvent jdevice
void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance)
int(* Open)(SDL_Joystick *joystick, int device_index)
SDL_JoystickID SDL_GetNextJoystickInstanceID()
int SDL_NumJoysticks(void)
@ SDL_JOYSTICK_TYPE_GUITAR
void SDL_UnlockJoysticks(void)
GLuint GLfloat GLfloat GLfloat x1
SDL_GameControllerType SDL_GetJoystickGameControllerType(const char *name, Uint16 vendor, Uint16 product, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
SDL_JoystickID SDL_JoystickGetDeviceInstanceID(int device_index)
#define SDL_InitSubSystem
#define SDL_small_alloc(type, count, pisstack)
Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
const char * SDL_GetCustomJoystickManufacturer(const char *manufacturer)
SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid)
@ SDL_JOYSTICK_TYPE_DANCE_PAD
Uint16 SDL_JoystickGetVendor(SDL_Joystick *joystick)
#define SDL_GetKeyboardFocus
SDL_bool has_initial_value
void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance)
int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
@ k_eControllerType_PS4Controller
@ SDL_CONTROLLER_TYPE_PS3
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick)
@ SDL_JOYSTICK_TYPE_DRUM_KIT
static SDL_INLINE const char * GuessControllerName(int nVID, int nPID)
Uint16 SDL_JoystickGetDeviceProduct(int device_index)
void SDL_GameControllerHandleDelayedGuideButton(SDL_Joystick *joystick)
SDL_bool SDL_IsJoystickSteamController(Uint16 vendor, Uint16 product)
@ SDL_CONTROLLER_TYPE_PS4
SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick)
SDL_bool SDL_IsJoystickXInput(SDL_JoystickGUID guid)
int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick)
void(* Update)(SDL_Joystick *joystick)
SDL_bool SDL_PrivateJoystickValid(SDL_Joystick *joystick)
#define SDL_GetEventState(type)
@ k_eControllerType_XBox360Controller
@ SDL_JOYSTICK_POWER_UNKNOWN
void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version)
static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid)
SDL_JoystickDriver SDL_HAIKU_JoystickDriver
SDL_Joystick * SDL_JoystickFromInstanceID(SDL_JoystickID instance_id)
static SDL_bool SDL_updating_joystick
@ SDL_JOYSTICK_TYPE_FLIGHT_STICK
static void UpdateEventsForDeviceRemoval()
Uint16 SDL_JoystickGetProductVersion(SDL_Joystick *joystick)
SDL_JoystickDriver SDL_DARWIN_JoystickDriver
SDL_Joystick * SDL_JoystickFromPlayerIndex(int player_index)
static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent()
GLuint const GLchar * name
int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state)
@ SDL_JOYSTICK_TYPE_THROTTLE
void SDL_JoystickQuit(void)
Uint16 SDL_JoystickGetDeviceProductVersion(int device_index)
int SDL_GameControllerInitMappings(void)
SDL_JoystickDriver SDL_DUMMY_JoystickDriver
static unsigned char nibble(char c)
@ k_eControllerType_SteamControllerV2
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriver **driver, int *driver_index)
#define MAKE_VIDPID(VID, PID)
static SDL_atomic_t SDL_next_joystick_instance_id
int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, Sint16 xrel, Sint16 yrel)
int SDL_JoystickNumAxes(SDL_Joystick *joystick)
void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLevel ePowerLevel)
static void SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
Uint16 SDL_JoystickGetProduct(SDL_Joystick *joystick)
static SDL_mutex * SDL_joystick_lock
#define SDL_JOYSTICK_AXIS_MAX
static int SDL_joystick_player_count
@ k_eControllerType_UnknownNonSteamController
void SDL_LockJoysticks(void)
int SDL_JoystickGetDevicePlayerIndex(int device_index)
static SDL_JoystickDriver * SDL_joystick_drivers[]
SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick)
Uint16 SDL_JoystickGetDeviceVendor(int device_index)
SDL_JoystickDriver SDL_WINDOWS_JoystickDriver
const char * SDL_JoystickName(SDL_Joystick *joystick)
#define SDL_OutOfMemory()
int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value)
static SDL_bool SDL_IsJoystickProductWheel(Uint32 vidpid)
SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick)
#define SDL_arraysize(array)
void SDL_GameControllerQuitMappings(void)
static SDL_Event events[EVENT_BUF_SIZE]
static SDL_bool SDL_IsJoystickProductFlightStick(Uint32 vidpid)
#define SDL_AddHintCallback
const char *(* GetDeviceName)(int device_index)
static SDL_JoystickID SDL_GetJoystickIDForPlayerIndex(int player_index)
void SDL_JoystickClose(SDL_Joystick *joystick)
int SDL_JoystickNumHats(SDL_Joystick *joystick)
GLsizei const GLfloat * value
@ k_eControllerType_PS3Controller
SDL_bool sent_initial_value
SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid)
A type representing an atomic integer value. It is a struct so people don't accidentally use numeric ...
@ SDL_JOYSTICK_TYPE_ARCADE_PAD
SDL_bool SDL_HasWindows(void)
void SDL_JoystickUpdate(void)
int SDL_JoystickNumBalls(SDL_Joystick *joystick)
static SDL_JoystickID * SDL_joystick_players
static SDL_Joystick * SDL_joysticks
static int SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id)
SDL_JoystickDriver SDL_LINUX_JoystickDriver
int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
SDL_JoystickGUID(* GetDeviceGUID)(int device_index)
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
@ SDL_CONTROLLER_TYPE_XBOX360
static SDL_bool SDL_IsJoystickProductThrottle(Uint32 vidpid)
SDL_bool has_second_value
int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
SDL_JoystickDriver SDL_IOS_JoystickDriver
#define SDL_DelHintCallback
void SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index)
void HIDAPI_UpdateDevices(void)
SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
SDL_Joystick * SDL_JoystickOpen(int device_index)
int(* GetDevicePlayerIndex)(int device_index)
@ SDL_JOYSTICK_TYPE_WHEEL
Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
@ SDL_CONTROLLER_TYPE_XBOXONE
GLuint GLuint GLsizei GLenum type
SDL_JoystickDriver SDL_EMSCRIPTEN_JoystickDriver
SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick)
@ SDL_JOYSTICK_TYPE_UNKNOWN
@ k_eControllerType_XBoxOneController
@ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
static int SDL_FindFreePlayerIndex()
SDL_JoystickDriver SDL_HIDAPI_JoystickDriver
@ SDL_JOYSTICK_TYPE_ARCADE_STICK
SDL_bool SDL_IsJoystickNintendoSwitchProInputOnly(Uint16 vendor, Uint16 product)
SDL_JoystickDriver SDL_ANDROID_JoystickDriver