mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 17:36:25 +00:00
Only update the battery status for Bluetooth Switch Pro controllers
Controllers that are plugged in are in the wired state
This commit is contained in:
@@ -2035,6 +2035,7 @@ static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_C
|
|||||||
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTY, ~axis);
|
SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTY, ~axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->device->is_bluetooth) {
|
||||||
/* High nibble of battery/connection byte is battery level, low nibble is connection status
|
/* High nibble of battery/connection byte is battery level, low nibble is connection status
|
||||||
* LSB of connection nibble is USB/Switch connection status
|
* LSB of connection nibble is USB/Switch connection status
|
||||||
*/
|
*/
|
||||||
@@ -2055,6 +2056,7 @@ static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_C
|
|||||||
SDL_SendJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_FULL);
|
SDL_SendJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx->m_bReportSensors) {
|
if (ctx->m_bReportSensors) {
|
||||||
SDL_bool bHasSensorData = (packet->imuState[0].sAccelZ != 0 ||
|
SDL_bool bHasSensorData = (packet->imuState[0].sAccelZ != 0 ||
|
||||||
|
Reference in New Issue
Block a user