Separate joystick power state into battery status and percentage

This allows you to see battery percentage while the controller is charging
This commit is contained in:
Sam Lantinga 2024-03-30 10:55:13 -07:00
parent 5e624c2083
commit 8847b35244
42 changed files with 596 additions and 1001 deletions

View file

@ -488,7 +488,8 @@ typedef struct SDL_JoyBatteryEvent
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_JoystickID which; /**< The joystick instance id */
SDL_JoystickPowerLevel level; /**< The joystick battery level */
SDL_PowerState state; /**< The joystick battery state */
int percent; /**< The joystick battery percent charge remaining */
} SDL_JoyBatteryEvent;
/**