summaryrefslogtreecommitdiff
path: root/src/input/joystick.cpp
diff options
context:
space:
mode:
authorewewukek <ewewukek@gmail.com>2024-01-10 23:11:14 +0300
committerewewukek <ewewukek@gmail.com>2024-03-27 13:18:30 +0300
commit55f9902343eff790c420ca3724c02e95664a9d25 (patch)
treee28e36935c70c6f9397f818ed35b6138d36df973 /src/input/joystick.cpp
parent531cf122d42900453102862caf94119c60d7f077 (diff)
downloadmanaverse-55f9902343eff790c420ca3724c02e95664a9d25.tar.gz
manaverse-55f9902343eff790c420ca3724c02e95664a9d25.tar.bz2
manaverse-55f9902343eff790c420ca3724c02e95664a9d25.tar.xz
manaverse-55f9902343eff790c420ca3724c02e95664a9d25.zip
Add a slider to joystick settings to set axis tolerance
Diffstat (limited to 'src/input/joystick.cpp')
-rw-r--r--src/input/joystick.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp
index 5396adadc..48b4488b0 100644
--- a/src/input/joystick.cpp
+++ b/src/input/joystick.cpp
@@ -198,12 +198,12 @@ bool Joystick::open()
#ifdef __SWITCH__
config.setValue("joystick" + toString(mNumber) + "calibrated", true);
- config.setValue("joystickTolerance" + toString(mNumber), 10000);
+ config.setValue("joystickTolerance", 10000);
#endif
mCalibrated = config.getValueBool("joystick"
+ toString(mNumber) + "calibrated", false);
- mTolerance = config.getIntValue("joystickTolerance" + toString(mNumber));
+ mTolerance = config.getIntValue("joystickTolerance");
mUseInactive = config.getBoolValue("useInactiveJoystick");
return true;
@@ -341,7 +341,7 @@ void Joystick::finishCalibration()
mCalibrated = true;
mCalibrating = false;
config.setValue("joystick" + toString(mNumber) + "calibrated", true);
- config.setValue("joystickTolerance" + toString(mNumber), mTolerance);
+ config.setValue("joystickTolerance", mTolerance);
}
bool Joystick::buttonPressed(const unsigned char no) const