diff --git a/WickedEngine/wiDirectInput.cpp b/WickedEngine/wiDirectInput.cpp index 12632188b..b844b3075 100644 --- a/WickedEngine/wiDirectInput.cpp +++ b/WickedEngine/wiDirectInput.cpp @@ -267,7 +267,7 @@ HRESULT DirectInput::poll(IDirectInputDevice8* joy,DIJOYSTATE2 *js) bool DirectInput::isButtonDown(short pIndex, unsigned int buttoncode) { - if(connectedJoys) + if(connectedJoys && buttoncode < 128) if(joyState[pIndex].rgbButtons[buttoncode-1]!=0) return true; return false; diff --git a/WickedEngine/wiInputManager.cpp b/WickedEngine/wiInputManager.cpp index ceff77232..3cfa42c0d 100644 --- a/WickedEngine/wiInputManager.cpp +++ b/WickedEngine/wiInputManager.cpp @@ -72,7 +72,7 @@ bool wiInputManager::down(DWORD button, InputType inputType, short playerindex) return true; break; case DIRECTINPUT_JOYPAD: - if (xinput != nullptr && xinput->isButtonDown(playerindex, button)){ + if (dinput != nullptr && ( dinput->isButtonDown(playerindex, button) || dinput->getDirections(playerindex)==button )){ return true; } break;