DualSense adaptive trigger support (#1561)

This commit is contained in:
ABeltramo
2025-04-02 04:45:25 +02:00
committed by GitHub
parent fabb4fdadc
commit d9c7a245ef
5 changed files with 83 additions and 1 deletions
+33
View File
@@ -38,6 +38,37 @@ struct GamepadState {
unsigned char lt, rt;
};
struct DualSenseOutputReport{
uint8_t validFlag0;
uint8_t validFlag1;
/* For DualShock 4 compatibility mode. */
uint8_t motorRight;
uint8_t motorLeft;
/* Audio controls */
uint8_t reserved[4];
uint8_t muteButtonLed;
uint8_t powerSaveControl;
uint8_t rightTriggerEffectType;
uint8_t rightTriggerEffect[DS_EFFECT_PAYLOAD_SIZE];
uint8_t leftTriggerEffectType;
uint8_t leftTriggerEffect[DS_EFFECT_PAYLOAD_SIZE];
uint8_t reserved2[6];
/* LEDs and lightbar */
uint8_t validFlag2;
uint8_t reserved3[2];
uint8_t lightbarSetup;
uint8_t ledBrightness;
uint8_t playerLeds;
uint8_t lightbarRed;
uint8_t lightbarGreen;
uint8_t lightbarBlue;
};
// activeGamepadMask is a short, so we're bounded by the number of mask bits
#define MAX_GAMEPADS 16
@@ -95,6 +126,8 @@ public:
void setControllerLED(uint16_t controllerNumber, uint8_t r, uint8_t g, uint8_t b);
void setAdaptiveTriggers(uint16_t controllerNumber, DualSenseOutputReport *report);
void handleTouchFingerEvent(SDL_TouchFingerEvent* event);
int getAttachedGamepadMask();