Phase 6 updates

Phase 6 · Slice 58 ·

The DualSense over HID

  • crates/script_host/src/dualsense.rs reads DualSense and DualSense Edge controllers over HID (hidapi; its pure-Rust backend on Windows) and drives them: input reports over USB (0x01) and Bluetooth (0x31, after reading the calibration feature report switches the pad to them; the short 0x01 reports before that read too), output reports for rumble and the light bar (Bluetooth's with their sequence tag and CRC-32). The firmware keeps the light bar (its blue glow) until a report's light bar setup releases it, so the first color goes after one that does. The platform's generic view of the same pad is skipped.
  • Scripts get Unity's DualSenseGamepadHID (and DualShockGamepad): its controls in Unity's order, PlayStation names (Cross, Circle, Square, Triangle, Options, Share, L1...), touchpadButton, playStationButton (systemButton), the triggers' clicks, micButton; DualShockGamepad.current; SetLightBarColor and SetMotorSpeedsAndLightBarColor (ControllerLight, API 54). Legacy Input numbers a DualSense's buttons and axes as Unity does a PlayStation pad's through DirectInput on Windows.
  • Checked by dualsense_layout (recorded in Unity 6000.3, exact) and by tests of the reports and the CRC; tried on a DualSense Edge over Bluetooth: every button, the sticks and triggers, rumble and light bar colors.
  • Next: the DualShock 4 the same way; adaptive triggers and the touchpad's touches; URP render features; humanoid avatars and retargeting.