From 09b42d5f42a93ade8dd9fa3f0f90ed660a500607 Mon Sep 17 00:00:00 2001 From: Shauleiz Date: Thu, 7 Jul 2016 09:21:30 +0300 Subject: [PATCH] Guide Button added In response to request: https://github.com/shauleiz/vXboxInterface/issues/2 --- API/vXboxInterface.cpp | 9 +++++++++ API/vXboxInterface.h | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/API/vXboxInterface.cpp b/API/vXboxInterface.cpp index 6f5e92f..f452233 100644 --- a/API/vXboxInterface.cpp +++ b/API/vXboxInterface.cpp @@ -308,6 +308,15 @@ namespace vXboxNS { return XOutputSetState(UserIndex, &g_Gamepad[UserIndex - 1]); } + VXBOX_API BOOL __cdecl SetBtnGD(UINT UserIndex, BOOL Press) + { + UINT Btn = XINPUT_GAMEPAD_GUIDE; + g_Gamepad[UserIndex - 1].wButtons &= ~Btn; + g_Gamepad[UserIndex - 1].wButtons |= Btn*Press; + return XOutputSetState(UserIndex, &g_Gamepad[UserIndex - 1]); + } + + VXBOX_API BOOL __cdecl SetTriggerL(UINT UserIndex, BYTE Value) // Left Trigger { g_Gamepad[UserIndex - 1].bLeftTrigger = Value; diff --git a/API/vXboxInterface.h b/API/vXboxInterface.h index e931556..a18be97 100644 --- a/API/vXboxInterface.h +++ b/API/vXboxInterface.h @@ -10,6 +10,8 @@ #define DPAD_RIGHT XINPUT_GAMEPAD_DPAD_RIGHT #define DPAD_OFF 0 +#define XINPUT_GAMEPAD_GUIDE 0x0400 // Undocumanted Guide button + #ifdef STATIC_LIB #undef VXBOX_API #define VXBOX_API @@ -43,7 +45,8 @@ extern "C" VXBOX_API BOOL __cdecl SetBtnRT(UINT UserIndex, BOOL Press); // Right Thumb/Stick VXBOX_API BOOL __cdecl SetBtnLB(UINT UserIndex, BOOL Press); // Left Bumper VXBOX_API BOOL __cdecl SetBtnRB(UINT UserIndex, BOOL Press); // Right Bumper - VXBOX_API BOOL __cdecl SetTriggerL(UINT UserIndex, BYTE Value); // Left Trigger + VXBOX_API BOOL __cdecl SetBtnGD(UINT UserIndex, BOOL Press); // Guide Button (Undocumanted) + VXBOX_API BOOL __cdecl SetTriggerL(UINT UserIndex, BYTE Value); // Left Trigger VXBOX_API BOOL __cdecl SetTriggerR(UINT UserIndex, BYTE Value); // Right Trigger VXBOX_API BOOL __cdecl SetAxisX(UINT UserIndex, SHORT Value); // Left Stick X VXBOX_API BOOL __cdecl SetAxisY(UINT UserIndex, SHORT Value); // Left Stick Y