Make it optional
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -49,5 +49,6 @@ namespace TLAC::Input
|
||||
void SetTapStates(BYTE keycode, float elapsed);
|
||||
|
||||
int xinput_num;
|
||||
bool rumble;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user