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

XInputGetStateEx? #16

Closed
MaulingMonkey opened this issue Jul 17, 2019 · 5 comments · Fixed by #24
Closed

XInputGetStateEx? #16

MaulingMonkey opened this issue Jul 17, 2019 · 5 comments · Fixed by #24

Comments

@MaulingMonkey
Copy link
Contributor

MaulingMonkey commented Jul 17, 2019

There's a bunch of hidden xinput functions in later XInput versions - in particular I'm wondering if you'd be interested in a PR to get XInputGetStateEx (ordinal 100) available, which exposes the Guide button on xbox 360 controllers.

http://reverseengineerlog.blogspot.com/2016/06/xinputs-hidden-functions.html

If so, there's also the question of what the behavior should be when the function is missing. On the one hand, implementing it as just yet another optional function would let the end user detect when it's missing. On the other hand, you're almost certain to just fall back on regular XInputGetState in those cases...

@MaulingMonkey MaulingMonkey changed the title XInputGetState XInputGetStateEx? Jul 17, 2019
@djeedai
Copy link

djeedai commented Dec 16, 2023

Note: XInputGetCapabilitiesEx() also contains the vendor ID and product ID of the device, which allow deriving a stable gamepad identifier across application restarts. This is missing to allow gilrs to implement its Gamepad::uuid(), which would allow applications to e.g. save per-device user preferences (button mappings, etc.).

https://gitlab.com/gilrs-project/gilrs/-/issues/153

This StackOverflow answer has some code explaining the fields (I think they're missing from the original link): https://stackoverflow.com/questions/64251320/is-it-possible-to-get-an-xinput-devices-name-product-id-vendor-id-or-some-oth/68879988#68879988

@Lokathor
Copy link
Owner

Can you also link the appropriate MSDN or other docs page for me to reference? I can try to get this all sorted out and released this weekend.

@djeedai
Copy link

djeedai commented Dec 16, 2023

As mentioned in those links, those APIs are unfortunately unofficial/undocumented. The official XInput API is pretty small and doesn't seem to contain anything to access the device ID.

@Lokathor
Copy link
Owner

Ah, okay. That's why I don't have any memory about reading docs for this function ever.

That shouldn't be a problem though, we can still do it.

@djeedai
Copy link

djeedai commented Dec 16, 2023

Awesome, thanks! The StackOverflow link has an example code in C showing the various fields for XInputGetCapabilitiesEx().

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 a pull request may close this issue.

3 participants