From 3b4cf311970b26b98ec090fa925dbb7cfb6e556c Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 9 Sep 2013 23:55:42 +0200 Subject: [PATCH] Try to prevent any remaining "stickiness" when you map analog axises to buttons/direction --- UI/EmuScreen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index f42b4488c0..0127b246a1 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -330,6 +330,8 @@ void EmuScreen::axis(const AxisInput &axis) { void EmuScreen::processAxis(const AxisInput &axis, int direction) { int result = KeyMap::AxisToPspButton(axis.deviceId, axis.axisId, direction); + int resultOpposite = KeyMap::AxisToPspButton(axis.deviceId, axis.axisId, -direction); + if (result == KEYMAP_ERROR_UNKNOWN_KEY) return; @@ -369,7 +371,9 @@ void EmuScreen::processAxis(const AxisInput &axis, int direction) { if (result != KEYMAP_ERROR_UNKNOWN_KEY) pspKey(result, KEY_UP); } else { + // Release both directions, trying to deal with some erratic controllers that can cause it to stick. pspKey(result, KEY_UP); + pspKey(resultOpposite, KEY_UP); } } }