Implement controller LED and battery protocol extensions

This commit is contained in:
Cameron Gutman 2023-07-02 16:44:41 -05:00
commit df283d80c6
5 changed files with 120 additions and 1 deletions

View file

@ -72,6 +72,10 @@ public:
void handleControllerTouchpadEvent(SDL_ControllerTouchpadEvent* event);
#endif
#if SDL_VERSION_ATLEAST(2, 24, 0)
void handleJoystickBatteryEvent(SDL_JoyBatteryEvent* event);
#endif
void handleJoystickArrivalEvent(SDL_JoyDeviceEvent* event);
void sendText(QString& string);
@ -82,6 +86,8 @@ public:
void setMotionEventState(uint16_t controllerNumber, uint8_t motionType, uint16_t reportRateHz);
void setControllerLED(uint16_t controllerNumber, uint8_t r, uint8_t g, uint8_t b);
void handleTouchFingerEvent(SDL_TouchFingerEvent* event);
int getAttachedGamepadMask();
@ -126,6 +132,8 @@ private:
void sendGamepadState(GamepadState* state);
void sendGamepadBatteryState(GamepadState* state, SDL_JoystickPowerLevel level);
void handleAbsoluteFingerEvent(SDL_TouchFingerEvent* event);
void emulateAbsoluteFingerEvent(SDL_TouchFingerEvent* event);