You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requesting an API to query a gamepad/joystick’s power level (Unknown/Empty/Low/Medium/Full/Wired).
Useful for showing “controller low battery” UI and for diagnostics in games that support long sessions and multiple local players.
Motivation / Use cases
Alert player when a wireless pad is about to die.
Prefer wired pads in tournaments or when recording replays.
Telemetry/debug overlays (e.g., per-player status in local multiplayer).
Parity with SDL, which LÖVE already uses.
Proposed API (Lua)
-- Optional convenience:
local seconds = joystick:getEstimatedBatterySeconds() -- if available; else nil
Behavior / Details
Values mirror SDL’s SDL_JoystickPowerLevel: Unknown, Empty, Low, Medium, Full, Wired.
For devices without a battery or with OS restrictions, return "unknown" (or enum Unknown).
Should not allocate or block; callable every frame.