From 241246606532e27c602b4e0cc5f9e1d9dd74290f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 21 Dec 2014 18:50:07 -0800 Subject: [PATCH] Allow an analog to press a button in any direction. This is the only remaining case in #4391, so fixes #4391. --- UI/EmuScreen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index a6586a73df..49653b93a4 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -15,6 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include #include "android/app-android.h" #include "base/display.h" #include "base/logging.h" @@ -534,9 +535,9 @@ void EmuScreen::processAxis(const AxisInput &axis, int direction) { if (!IsAnalogStickKey(results[i])) pspKey(results[i], KEY_DOWN); } - // Also unpress the other direction. + // Also unpress the other direction (unless both directions press the same key.) for (size_t i = 0; i < resultsOpposite.size(); i++) { - if (!IsAnalogStickKey(resultsOpposite[i])) + if (!IsAnalogStickKey(resultsOpposite[i]) && std::find(results.begin(), results.end(), resultsOpposite[i]) == results.end()) pspKey(resultsOpposite[i], KEY_UP); } } else if (axisState == 0) {