mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-08 04:25:37 +00:00
InputManager: Workaround macro chord trigger issue
This commit is contained in:
parent
e987b56aae
commit
c970740d12
@ -904,6 +904,23 @@ void InputManager::AddPadBindings(const SettingsInterface& si, const std::string
|
||||
{
|
||||
const float deadzone =
|
||||
si.GetFloatValue(section.c_str(), fmt::format("Macro{}Deadzone", macro_button_index + 1).c_str(), 0.0f);
|
||||
for (const std::string& binding : bindings)
|
||||
{
|
||||
// We currently can't use chords with a deadzone.
|
||||
if (binding.find('&') != std::string::npos || deadzone == 0.0f)
|
||||
{
|
||||
if (deadzone != 0.0f)
|
||||
WARNING_LOG("Chord binding {} not supported with trigger deadzone {}.", binding, deadzone);
|
||||
|
||||
AddBinding(binding, InputButtonEventHandler{[pad_index, macro_button_index](bool state) {
|
||||
if (!System::IsValid())
|
||||
return;
|
||||
|
||||
SetMacroButtonState(pad_index, macro_button_index, state);
|
||||
}});
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBindings(bindings, InputAxisEventHandler{[pad_index, macro_button_index, deadzone](float value) {
|
||||
if (!System::IsValid())
|
||||
return;
|
||||
@ -913,6 +930,8 @@ void InputManager::AddPadBindings(const SettingsInterface& si, const std::string
|
||||
}});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cinfo->vibration_caps != Controller::VibrationCapabilities::NoVibration)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user