From 3f77bb1da5c706b93973a22f99e06adcb405a7fe Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Mon, 15 Jul 2019 02:55:15 +0200 Subject: [PATCH] Reduce in-game axis bind threshold for mouse control. --- Common/KeyMap.h | 1 + UI/EmuScreen.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/KeyMap.h b/Common/KeyMap.h index 73cf673d19..99961f1198 100644 --- a/Common/KeyMap.h +++ b/Common/KeyMap.h @@ -71,6 +71,7 @@ enum DefaultMaps { }; const float AXIS_BIND_THRESHOLD = 0.75f; +const float AXIS_BIND_THRESHOLD_MOUSE = 0.01f; typedef std::map> KeyMapping; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 8cb35e8065..3f07205e62 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -884,9 +884,10 @@ void EmuScreen::processAxis(const AxisInput &axis, int direction) { KeyMap::AxisToPspButton(axis.deviceId, axis.axisId, -direction, &resultsOpposite); int axisState = 0; - if ((direction == 1 && axis.value >= AXIS_BIND_THRESHOLD)) { + float threshold = g_Config.bMouseControl ? AXIS_BIND_THRESHOLD_MOUSE : AXIS_BIND_THRESHOLD; + if (direction == 1 && axis.value >= threshold) { axisState = 1; - } else if (direction == -1 && axis.value <= -AXIS_BIND_THRESHOLD) { + } else if (direction == -1 && axis.value <= -threshold) { axisState = -1; } else { axisState = 0;