mode_sinput.h 892 B

123456789101112131415161718192021222324
  1. // mode_sinput.h -- SInput personality (MODE_SINPUT): the open SDL-native gamepad protocol.
  2. //
  3. // SInput (Hand Held Legend, docs.handheldlegend.com/s/sinput) is a HID protocol SDL3 and Steam Input bind
  4. // natively via a dedicated driver, so a device can expose analog sticks, analog triggers, gyro/accel, TWO
  5. // touchpads and battery at once without pretending to be somebody else's controller -- which is exactly the
  6. // SC2's shape. Enumerates as the generic SInput device 2E8A:10C6 (the ID SDL's driver matches on).
  7. #pragma once
  8. #include "controllers.h"
  9. class SInputController : public IController {
  10. public:
  11. void begin() override;
  12. void task() override;
  13. bool dynamicMount() const override
  14. {
  15. return true;
  16. }
  17. uint8_t maxSlots() const override;
  18. void usbIdentity() override;
  19. void beginPool() override;
  20. void mountSlots(uint8_t k) override;
  21. };
  22. extern SInputController g_sinputCtl;