mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
nJoy: Fixed the 360 pad triggers with XInput, now they are separate triggers that work just like they should
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1953 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -270,12 +270,18 @@ void ConfigBox::DoGetButtons(int GetId)
|
||||
// Get the current controller
|
||||
int Controller = notebookpage;
|
||||
|
||||
// Get the controller and trigger type
|
||||
int ControllerType = joysticks[Controller].controllertype;
|
||||
int TriggerType = joysticks[Controller].triggertype;
|
||||
|
||||
// Collect the accepted buttons for this slot
|
||||
bool LeftRight = (GetId == IDB_SHOULDER_L || GetId == IDB_SHOULDER_R);
|
||||
bool Axis = (GetId >= IDB_ANALOG_MAIN_X && GetId <= IDB_SHOULDER_R);
|
||||
bool Axis = (GetId >= IDB_ANALOG_MAIN_X && GetId <= IDB_SHOULDER_R)
|
||||
&& (TriggerType == CTL_TRIGGER_SDL);
|
||||
bool XInput = (TriggerType == CTL_TRIGGER_XINPUT);
|
||||
bool Button = (GetId >= IDB_BUTTON_A && GetId <= IDB_BUTTONHALFPRESS)
|
||||
|| (GetId == IDB_SHOULDER_L || GetId == IDB_SHOULDER_R)
|
||||
|| (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT && joysticks[Controller].controllertype == CTL_DPAD_CUSTOM);
|
||||
|| (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT && ControllerType == CTL_DPAD_CUSTOM);
|
||||
bool Hat = (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT)
|
||||
&& (joysticks[Controller].controllertype == CTL_DPAD_HAT);
|
||||
|
||||
@ -383,6 +389,20 @@ void ConfigBox::DoGetButtons(int GetId)
|
||||
}
|
||||
}
|
||||
|
||||
// Check for a XInput trigger
|
||||
if(XInput)
|
||||
{
|
||||
for(int i = 0; i <= XI_TRIGGER_R; i++)
|
||||
{
|
||||
if(XInput::GetXI(0, i))
|
||||
{
|
||||
pressed = i + 1000;
|
||||
type = CTL_AXIS;
|
||||
Succeed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for keyboard action
|
||||
if (g_Pressed && Button)
|
||||
{
|
||||
|
Reference in New Issue
Block a user