mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 06:45:59 +00:00
joystick: Fix connection type for Steam Controller and Xbox 360 dongles
This commit is contained in:
@@ -1153,6 +1153,10 @@ static bool HIDAPI_DriverSteam_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joyst
|
|||||||
joystick->naxes = SDL_GAMEPAD_AXIS_COUNT;
|
joystick->naxes = SDL_GAMEPAD_AXIS_COUNT;
|
||||||
joystick->nhats = 1;
|
joystick->nhats = 1;
|
||||||
|
|
||||||
|
if (IsDongle(device->product_id)) {
|
||||||
|
joystick->connection_state = SDL_JOYSTICK_CONNECTION_WIRELESS;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, update_rate_in_hz);
|
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, update_rate_in_hz);
|
||||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, update_rate_in_hz);
|
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, update_rate_in_hz);
|
||||||
|
|
||||||
|
@@ -178,6 +178,7 @@ static bool HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Jo
|
|||||||
joystick->nbuttons = 11;
|
joystick->nbuttons = 11;
|
||||||
joystick->naxes = SDL_GAMEPAD_AXIS_COUNT;
|
joystick->naxes = SDL_GAMEPAD_AXIS_COUNT;
|
||||||
joystick->nhats = 1;
|
joystick->nhats = 1;
|
||||||
|
joystick->connection_state = SDL_JOYSTICK_CONNECTION_WIRELESS;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user