Only update the battery status for Bluetooth Switch Pro controllers
Controllers that are plugged in are in the wired statemain
parent
87794d03ad
commit
09d1e9defb
|
@ -2035,6 +2035,7 @@ static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_C
|
|||
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
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->m_bReportSensors) {
|
||||
SDL_bool bHasSensorData = (packet->imuState[0].sAccelZ != 0 ||
|
||||
|
|
Loading…
Reference in New Issue