mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Try to prevent any remaining "stickiness" when you map analog axises to buttons/direction
This commit is contained in:
1 parent
b24ea4014a
commit
3b4cf31197
1 file changed
+4
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user