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.
This commit is contained in:
LunaMoo committed 2019-07-15 21:17:58 +02:00
1 parent ecc5441cd0
commit 9927b30dc6
3 files changed
+6 -5

No files matched your search

+1
View File
@@ -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<int, std::vector<KeyDef>> KeyMapping;
+4 -4
View File
@@ -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);
+1 -1
View File
@@ -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;
});