Skip to content

Rename DualSenseDriver → PlayStationDriver (re-targeting main)#4

Merged
petegordon merged 1 commit into
mainfrom
chore/rename-playstation-driver-to-main
May 24, 2026
Merged

Rename DualSenseDriver → PlayStationDriver (re-targeting main)#4
petegordon merged 1 commit into
mainfrom
chore/rename-playstation-driver-to-main

Conversation

@petegordon

Copy link
Copy Markdown
Member

Summary

Re-targets the rename to main. The original PR #2 was approved and merged, but its base was the feat/device-dictionary-and-wizard branch (the dictionary PR), not main. When PR #1 (dictionary) was merged to main first and PR #2 was merged into its (now stale) feature branch second, the rename ended up "stuck" on the feature branch and never reached main. Main still has DualSenseDriver.

This PR is a pure cherry-pick of the original rename commit (44ee8dc) onto a branch off the current main. No new content; identical to PR #2 in scope.

  • File: packages/core/src/drivers/dualsense-driver.jsplaystation-driver.js (via git mv so history follows)
  • Class: DualSenseDriverPlayStationDriver
  • Module header expanded to spell out the DS4 + DS5 + clone coverage
  • All references in devices.js, index.js, controller-registry.js, core README, and the onboarding doc updated
  • PROTOCOLS map key preserved as 'dualsense' (with explanatory comment) so the visualizer's PROFILES['dualsense'] GLB continues to load for all Sony entries without forcing a controllerProfile override on every PlayStation entry

Test plan

  • Local smoke test: node --input-type=module -e "import('@usersfirst/controller-core').then(m => console.log(Object.keys(m).filter(k => k.endsWith('Driver'))))" lists PlayStationDriver (not DualSenseDriver).
  • m.PROTOCOLS[m.ControllerRegistry.getEntry(0x054c, 0x0ce6).protocol].name returns PlayStationDriver.
  • Overlay launches; DualSense detection still works.

🤖 Generated with Claude Code

The class covers both DualSense (DS5) and DualShock 4 (DS4) USB protocols
plus their clones (GameSir Super Nova / Cyclone 2 in DS4 mode). Naming it
"DualSenseDriver" was misleading — DualSense is one specific physical
controller, not the protocol family — and users hit that confusion in
practice ("I have a DualSense, not a DualShock, why is the file/class
named like that?").

Pure rename, no behavior change:
  - File: packages/core/src/drivers/{dualsense → playstation}-driver.js
    (via git mv so history follows)
  - Class: DualSenseDriver → PlayStationDriver
  - Module header comment expanded to spell out which protocols it
    covers and which clones spoof them.

Preserved on purpose:
  - PROTOCOLS map key stays 'dualsense'. The visualizer's PROFILES
    table uses 'dualsense' as its profile key, and entry.controllerProfile
    defaults to entry.protocol → 'dualsense' for all Sony entries. Renaming
    the protocol key would force a controllerProfile: 'dualsense' override
    on every PlayStation entry just to keep the same GLB loading. Not
    worth the churn for a cosmetic improvement. A comment in PROTOCOLS
    explains the historical naming.

Touched files:
  - packages/core/src/drivers/playstation-driver.js (renamed + class +
    static method references DualSenseDriver._parseTouchPoint /
    ._crc32 updated)
  - packages/core/src/devices.js (import + PROTOCOLS map entry)
  - packages/core/src/index.js (barrel re-export)
  - packages/core/src/drivers/controller-registry.js (one comment)
  - packages/core/README.md (subpath-exports table)
  - docs/ADDING-A-CONTROLLER.md (protocol-table row + the worked-example
    code-link)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant