Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [DllImport("xinput1_3.dll", EntryPoint = "#100")]
- static extern int secret_get_gamepad(int playerIndex, out XINPUT_GAMEPAD_SECRET struc);
- public struct XINPUT_GAMEPAD_SECRET
- {
- public UInt32 eventCount;
- public ushort wButtons;
- public Byte bLeftTrigger;
- public Byte bRightTrigger;
- public short sThumbLX;
- public short sThumbLY;
- public short sThumbRX;
- public short sThumbRY;
- }
- public XINPUT_GAMEPAD_SECRET xgs;
- bool testHomeButton()
- {
- int stat;
- bool val;
- for (int i = 0; i < 4; i++)
- {
- stat = secret_get_gamepad(0, out xgs);
- if (stat != 0) continue;
- val = ((xgs.wButtons & 0x0400) != 0);
- if (val) return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement