Skip to content

Non-ds5 controller was processed #6

@mwx0621

Description

@mwx0621

Thanks for your great work! This helped me a lot on dealing with chrome before v89.

While applying this pack, I found a bug with search here
https://github.com/thayallans/ds5chrome/blob/4fbc7ddc3a6fa4aad699f9f16046f8218be442cf/ds5.js#L23C13-L23C96

if (
     initialGamepads[index] !== null &&
     (initialGamepads[index].id.search(regex)) // this will return -1 for non-ds5 controller
) {...}

(initialGamepads[index].id.search(regex)) will always return true. All controller will be recognized as ds5.

Use includes instead will simply solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions