From 55f9902343eff790c420ca3724c02e95664a9d25 Mon Sep 17 00:00:00 2001 From: ewewukek Date: Wed, 10 Jan 2024 23:11:14 +0300 Subject: Add a slider to joystick settings to set axis tolerance --- src/input/joystick.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/input/joystick.cpp') 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 -- cgit v1.2.3-70-g09d2