sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.68k stars 641 forks source link

[Feature Request] Implement Xbox Guide button support via secret endpoint #1074

Open evilC opened 5 years ago

evilC commented 5 years ago

Hi, would it be at all possible to add support for reading the Xbox Guide button via SharpDX.XInput?
Apparently this can be done via a "Secret" endpoint.

This is an un-named endpoint, but Nefarius reckons you can access it via an ordinal.

He provided me with the following code samples to pass along:

[DllImport("xinput1_4.dll", EntryPoint="#100")]
public static extern int XInputGetStateSecret
(
    int dwUserIndex,  // [in] Index of the gamer associated with the device
    ref XInputState pState        // [out] Receives the current state
);

https://github.com/ViGEm/VDX/blob/master/src/Main.cpp#L136-L145
https://github.com/ViGEm/VDX/blob/master/src/Main.cpp#L53-L63

If you guys are not up for implementing yourself, but are open to a PR, then gimme dat "PR Welcome" tag and I will see about implementing it myself :)

nefarius commented 5 years ago

I'd be ready to get my hands dirty but I fail to build the solution 😝