mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 07:28:30 +00:00
Initial support for hotplugging mice and keyboards
This commit is contained in:
@@ -682,6 +682,25 @@ SDL_bool SDL_JoystickHandledByAnotherDriver(struct SDL_JoystickDriver *driver, U
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasJoystick(void)
|
||||
{
|
||||
int i;
|
||||
int total_joysticks = 0;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
for (i = 0; i < SDL_arraysize(SDL_joystick_drivers); ++i) {
|
||||
total_joysticks += SDL_joystick_drivers[i]->GetCount();
|
||||
}
|
||||
}
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
if (total_joysticks > 0) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_JoystickID *SDL_GetJoysticks(int *count)
|
||||
{
|
||||
int i, num_joysticks, device_index;
|
||||
|
Reference in New Issue
Block a user