Skip to content

Conversation

AlexTyrer
Copy link
Contributor

@AlexTyrer AlexTyrer commented Sep 10, 2024

Description

A previous PR (#1990) improved the performance on DualShockSupport initialization by no longer requiring a RegEx match for DualShock3 and DualShock4 devices.

Unfortunately this had the unintended consequence of causing a DualSense device to be recognized as DualShock4.

This PR addresses that defect.

Changes made

Removing the extra .WithManufacturerContains() line reduces the score returned by these generic matchers ensuring the PID/VID matcher wins when matching DualSense devices.

Testing

Local testing, automated tests.

Risk

No risk - just restores the previous behaviour.

Checklist

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

…DualSense devices too!

o The generic DualShock4GamepadHID InputDeviceMatcher would erroneously claim to
match DualSense devices based on the simplistic count of how many properties match.

o The previous regex removal change added another WithManufacturerContains() which
increased their score when comparing against DualSense controllers making the DualShock4
the best match.

o Removing the additional property match restores the original behaviour.

o DualShock3GamepadHID has also been fixed here.

o These generic matchers are problematic and were only added to work around a defect in an
older version of OSX when connecting over Bluetooth where no product or vendor were reported.
This defect is no longer present on MacOS but these matchers are kept to support off-brand devices.

o Ideally we could weight VID and PID properties more heavily.
@Pauliusd01
Copy link
Collaborator

Sorry @stefanunity could you take this one over from me

@stefanunity stefanunity removed the request for review from Pauliusd01 September 11, 2024 09:35
Copy link
Collaborator

@stefanunity stefanunity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DS4 and DS are recognized with their correct names and mappings work.

@AlexTyrer AlexTyrer merged commit d5cc3fd into develop Sep 12, 2024
77 checks passed
@AlexTyrer AlexTyrer deleted the isx-1411-input-device-matcher-dualshock-fix branch September 12, 2024 15:43
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.

4 participants