Merge pull request #7211 from unknownbrackets/ctrl

Allow an analog to press a button in any direction
This commit is contained in:
Henrik Rydgård committed 2014-12-22 09:32:46 +01:00
commit bc6da491f4
1 file changed
+3 -2
+3 -2
View File
@@ -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 <algorithm>
#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) {