diff --git a/Core/Config.cpp b/Core/Config.cpp index b20b7f62e6fd..160238bc4155 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -857,6 +857,7 @@ static ConfigSetting controlSettings[] = { ConfigSetting("TiltSensitivityX", &g_Config.iTiltSensitivityX, 100, true, true), ConfigSetting("TiltSensitivityY", &g_Config.iTiltSensitivityY, 100, true, true), ConfigSetting("DeadzoneRadius", &g_Config.fDeadzoneRadius, 0.2f, true, true), + ConfigSetting("TiltDeadzoneSkip", &g_Config.fTiltDeadzoneSkip, 0.0f, true, true), ConfigSetting("TiltInputType", &g_Config.iTiltInputType, 0, true, true), #endif diff --git a/Core/Config.h b/Core/Config.h index d8a52cccde9d..2a9ce9d8857d 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -274,6 +274,8 @@ struct Config { int iTiltSensitivityY; //the deadzone radius of the tilt float fDeadzoneRadius; + // deadzone skip + float fTiltDeadzoneSkip; //type of tilt input currently selected: Defined in TiltEventProcessor.h //0 - no tilt, 1 - analog stick, 2 - D-Pad, 3 - Action Buttons (Tri, Cross, Square, Circle) int iTiltInputType; diff --git a/UI/TiltAnalogSettingsScreen.cpp b/UI/TiltAnalogSettingsScreen.cpp index fd427dbf2973..9a0fcf3f1878 100644 --- a/UI/TiltAnalogSettingsScreen.cpp +++ b/UI/TiltAnalogSettingsScreen.cpp @@ -41,6 +41,7 @@ void TiltAnalogSettingsScreen::CreateViews() { settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityX, 0, 100, co->T("Tilt Sensitivity along X axis"), screenManager(),"%")); settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityY, 0, 100, co->T("Tilt Sensitivity along Y axis"), screenManager(),"%")); settings->Add(new PopupSliderChoiceFloat(&g_Config.fDeadzoneRadius, 0.0, 1.0, co->T("Deadzone Radius"), 0.01f, screenManager(),"/ 1.0")); + settings->Add(new PopupSliderChoiceFloat(&g_Config.fTiltDeadzoneSkip, 0.0, 1.0, co->T("Deadzone Skip"), 0.01f, screenManager(),"/ 1.0")); settings->Add(new ItemHeader(co->T("Calibration"))); InfoItem *calibrationInfo = new InfoItem(co->T("To Calibrate", "To calibrate, keep device on a flat surface and press calibrate."), ""); diff --git a/UI/TiltEventProcessor.cpp b/UI/TiltEventProcessor.cpp index 77c2fa259455..cab622304340 100644 --- a/UI/TiltEventProcessor.cpp +++ b/UI/TiltEventProcessor.cpp @@ -18,9 +18,9 @@ inline float tiltInputCurve (float x, float deadzone, float sensitivity) { const float factor = sensitivity * 1.0f / (1.0f - deadzone); if (x > deadzone) { - return (x - deadzone) * factor * factor; + return (x + g_Config.fTiltDeadzoneSkip - deadzone) * factor * factor; } else if (x < -deadzone) { - return (x + deadzone) * factor * factor; + return (x - g_Config.fTiltDeadzoneSkip + deadzone) * factor * factor; } else { return 0.0f; }