From 9927b30dc6aecfaa03939ab72753b4e51a8a152f Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Mon, 15 Jul 2019 21:17:58 +0200 Subject: [PATCH] Re-add AXIS_BIND_THRESHOLD to help with mapping since I changed it for mouse differently now, left the option, but only for analog sticks now as such renamed it. --- Common/KeyMap.h | 1 + UI/ControlMappingScreen.cpp | 8 ++++---- UI/GameSettingsScreen.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Common/KeyMap.h b/Common/KeyMap.h index 17eb268049..345cff9a57 100644 --- a/Common/KeyMap.h +++ b/Common/KeyMap.h @@ -70,6 +70,7 @@ enum DefaultMaps { DEFAULT_MAPPING_XPERIA_PLAY, }; +const float AXIS_BIND_THRESHOLD = 0.75f; const float AXIS_BIND_THRESHOLD_MOUSE = 0.01f; typedef std::map> KeyMapping; diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 4b6ebbd0c6..f566a7faff 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -385,7 +385,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) { if (IgnoreAxisForMapping(axis.axisId)) return false; - if (axis.value > g_Config.fAxisBindThreshold) { + if (axis.value > AXIS_BIND_THRESHOLD) { mapped_ = true; KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1)); TriggerFinish(DR_OK); @@ -393,7 +393,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) { callback_(kdf); } - if (axis.value < -g_Config.fAxisBindThreshold) { + if (axis.value < -AXIS_BIND_THRESHOLD) { mapped_ = true; KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, -1)); TriggerFinish(DR_OK); @@ -409,7 +409,7 @@ bool KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) { if (IgnoreAxisForMapping(axis.axisId)) return false; - if (axis.value > g_Config.fAxisBindThreshold) { + if (axis.value > AXIS_BIND_THRESHOLD) { mapped_ = true; KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1)); TriggerFinish(DR_OK); @@ -417,7 +417,7 @@ bool KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) { callback_(kdf); } - if (axis.value < -g_Config.fAxisBindThreshold) { + if (axis.value < -AXIS_BIND_THRESHOLD) { mapped_ = true; KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, -1)); TriggerFinish(DR_OK); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 145e4fa86a..4e5624f6a3 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -555,7 +555,7 @@ void GameSettingsScreen::CreateViews() { auto axisToButton = new PopupSliderChoiceFloat(&g_Config.fAxisBindThreshold, 0.01f, 0.96f, co->T("Axis to button threshold"), 0.05f, screenManager()); controlsSettings->Add(axisToButton); axisToButton->OnChange.Add([=](EventParams &e) { - settingInfo_->Show(co->T("AxisToButton Tip", "Affects how far you have to push the stick(or move mouse on supported platforms) to trigger button mapped to it."), e.v); + settingInfo_->Show(co->T("AxisToButton Tip", "Affects how far you have to push the analog stick(not mouse) to trigger the PSP button mapped to it."), e.v); return UI::EVENT_CONTINUE; });