Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: joy_name indexes correctly referenced #12

Merged
merged 1 commit into from
May 31, 2024
Merged

Conversation

Varedis
Copy link
Contributor

@Varedis Varedis commented May 21, 2024

Fixes the automatic detection of controllers

find returns the index of where the string was found in the word. Controllers were always defaulting to XBox if the match was at index 0. An example is the PS4 Controller it was matching at index 0 on the joy_name.find("PS") criteria, so it was being classed as falsy and then falling through to the else.

Example

PS4 Controller before fix:

image

PS4 Controller after fix:

image

@Varedis
Copy link
Contributor Author

Varedis commented May 21, 2024

@Pennycook I hope you don't mind me fixing this issue I found

Copy link
Owner

@Pennycook Pennycook left a comment

Choose a reason for hiding this comment

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

Thank you for finding this. I don't have a PlayStation or Nintendo controller that work with my machine, and so I wasn't able to test the behavior here.

@Pennycook Pennycook merged commit 88d461d into Pennycook:main May 31, 2024
1 check passed
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.

2 participants