From 140ba017945feab39cdd8a82c25396b985c10b74 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Tue, 20 Jan 2009 14:41:58 +0000 Subject: [PATCH] nJoy: Fixed configuration bug git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1957 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp index 9a426b0307..7452bc472d 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp @@ -276,14 +276,18 @@ void ConfigBox::DoGetButtons(int GetId) // 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) - && (TriggerType == CTL_TRIGGER_SDL); + && !(TriggerType == CTL_TRIGGER_XINPUT && (GetId == IDB_SHOULDER_L || GetId == IDB_SHOULDER_R) ); // Don't allow SDL here + 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 && ControllerType == CTL_DPAD_CUSTOM); - bool Hat = (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT) - && (joysticks[Controller].controllertype == CTL_DPAD_HAT); + + bool Button = (GetId >= IDB_BUTTON_A && GetId <= IDB_BUTTONHALFPRESS) // All digital buttons + || (GetId == IDB_SHOULDER_L || GetId == IDB_SHOULDER_R) // both shoulder buttons + || (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT && ControllerType == CTL_DPAD_CUSTOM); // Or the custom hat mode + + bool Hat = (GetId >= IDB_DPAD_UP && GetId <= IDB_DPAD_RIGHT) // All DPads + && (joysticks[Controller].controllertype == CTL_DPAD_HAT); // Not with the hat option defined /* Open a new joystick. Joysticks[controller].GetId is the system GetId of the physical joystick that is mapped to controller, for example 0, 1, 2, 3 for the first four joysticks */