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

Block to get details of gamepads #881

Closed
wants to merge 2 commits into from

Conversation

DNin01
Copy link
Contributor

@DNin01 DNin01 commented Aug 13, 2023

Resolves #147

Adds a block to the Gamepad extension that allows you to get information about connected gamepads.

At some point, I'd like to add a way to get the model (like is this an Xbox One controller or a PlayStation DualShock or...?) so you don't ever have to write your own code to use the vendor or product to tell what kind of controller it is, you just leave it up to the block and it'll tell you. I've already done some work on such a function, I just need to find more information so it works on more controllers.

It'd also be nice to add cross-browser compatibility. Currently, the vendor and product matching functions only work properly on Chromium-based browsers. For Firefox, see Gamepad: id property.

Tested in Edge 115.

@GarboMuffin
Copy link
Member

I really do not like the idea of exposing vendor IDs directly to projects.

There are some example IDs on https://hardwaretester.com/gamepad, notably you have things like:

  • 054c-09cc-Wireless Controller
  • xinput
  • Wireless Controller Extended Gamepad

which aren't even that uncommon.

would much rather have the extension figure out all the details that matter instead

@Drago-Cuven
Copy link

would you be ok with me keeping my PR up?

@DNin01
Copy link
Contributor Author

DNin01 commented Sep 8, 2023

would you be ok with me keeping my PR up?

@Martinelplayz To sail smoothly, I think it makes more sense not to make PRs that combine work from other PRs unless they are specifically meant to supersede and improve upon them since, you know, if either yours or mine gets merged as they are, one of us will need to fix conflicts. Merging the two PRs separately will only cause a conflict if both edit the same line or something like that. Merging separately will work just as well and allow us to make edits as we see fit (there's a reason this PR is a draft).

Technically, you can keep it open if you want - I agree to the GPL-v3 license by submitting a PR, you've already provided credit on the PR description, and the code is not too hard for anyone to come up with. I would ask that you remove L5 as you may not have written the added code, and we typically don't add comments indicating editors.

However, I will note that GarboMuffin commented that it's probably a better idea to have the extension figure out what kind of controller is being used instead of exposing the small details to the project and having it figure out, so keep that in mind - it might not be accepted. You can try to make something like my idea of putting together details to return a type of controller if you want, but it can get pretty tricky as there are a lot of different controllers, from XInput to DualShock to Joy-Con controller to Stadia controller... yeah. Even I need to learn more about them.

@DNin01
Copy link
Contributor Author

DNin01 commented Sep 8, 2023

If you just want to help, you can always make suggestions for the PR authors through the "Files changed" tab.

@DNin01
Copy link
Contributor Author

DNin01 commented Feb 16, 2024

I don't really like making figuring out the controller model the responsibility of project creators either, so I'm going to close this pull request and propose a new implementation later.

@DNin01 DNin01 closed this Feb 16, 2024
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.

Gamepad: Add a way to tell what kind of gamepad you're using
3 participants