mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-07 13:53:17 +00:00
Send the normal sensor data for the right Joy-Con controller in combined mode
This commit is contained in:
@@ -592,6 +592,8 @@ static bool HIDAPI_DriverSwitch2_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
||||
break;
|
||||
case USB_PRODUCT_NINTENDO_SWITCH2_JOYCON_RIGHT:
|
||||
if (ctx->device->parent) {
|
||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 250.0f);
|
||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 250.0f);
|
||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO_R, 250.0f);
|
||||
SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL_R, 250.0f);
|
||||
}
|
||||
@@ -1212,6 +1214,8 @@ static void HIDAPI_DriverSwitch2_HandleStatePacket(SDL_HIDAPI_Device *device, SD
|
||||
break;
|
||||
case USB_PRODUCT_NINTENDO_SWITCH2_JOYCON_RIGHT:
|
||||
if (ctx->device->parent) {
|
||||
SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_GYRO, sensor_timestamp, gyro_data, 3);
|
||||
SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_ACCEL, sensor_timestamp, accel_data, 3);
|
||||
SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_GYRO_R, sensor_timestamp, gyro_data, 3);
|
||||
SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_ACCEL_R, sensor_timestamp, accel_data, 3);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user