diff --git a/source-code/data/plugins/keyconfig.ini b/source-code/data/plugins/keyconfig.ini index a42511d..c41a757 100644 --- a/source-code/data/plugins/keyconfig.ini +++ b/source-code/data/plugins/keyconfig.ini @@ -8,15 +8,18 @@ # Options: -# allows the user to mouse wheel scroll through the PV selection list +# Allow the user to mouse wheel scroll through the PV selection list mouse_scroll_pv_selection = true -# the interval it takes for the emulated slider touch points to move from one contact point to another. -# in most cases this does not need editing. +# The interval it takes for the emulated slider touch points to move from one contact point to another. +# In most cases, this does not need editing. touch_slider_emulation_speed = 750.0 -# preferred Xinput controller (0-3) +# Preferred Xinput controller (0-3) xinput_preferred = 0 +# Rumble (Xinput) +rumble = true + # JVS Buttons: JVS_TEST = F1 JVS_SERVICE = F2 diff --git a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp index 0e2e353..9881a21 100644 --- a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp +++ b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp @@ -15,6 +15,7 @@ namespace TLAC::Input TLAC::FileSystem::ConfigFile config(TLAC::framework::GetModuleDirectory(), "keyconfig.ini"); config.OpenRead(); xinput_num = config.GetIntegerValue("xinput_preferred"); + rumble = config.GetBooleanValue("rumble"); } Xinput* Xinput::GetInstance() @@ -227,13 +228,13 @@ namespace TLAC::Input SetTapStates(i, elapsed); } - if (TLAC::Components::TargetInspector::ShouldVibrate) + if (rumble && TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched() && TLAC::Components::TargetInspector::ShouldVibrate) { XINPUT_VIBRATION vibration; ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION)); vibration.wLeftMotorSpeed = 8000; // use any value between 0-65535 here vibration.wRightMotorSpeed = 4000; // use any value between 0-65535 here - if (TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched()) XInputSetState(xc_pref, &vibration); + XInputSetState(xc_pref, &vibration); } else { diff --git a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.h b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.h index 6a6ed38..c8c5456 100644 --- a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.h +++ b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.h @@ -49,5 +49,6 @@ namespace TLAC::Input void SetTapStates(BYTE keycode, float elapsed); int xinput_num; + bool rumble; }; }