Skip to content

Commit

Permalink
Guide Button added
Browse files Browse the repository at this point in the history
In response to request: #2
  • Loading branch information
shauleiz committed Jul 7, 2016
1 parent 92203dc commit 09b42d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions API/vXboxInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion API/vXboxInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 09b42d5

Please sign in to comment.