Qt: Require non-zero displacement for reverse axis binding

Should hopefully work around controllers with digital triggers getting
flagged as inverted bindings.
pull/3576/head
Stenzek 1 month ago
parent 055caf5cbe
commit fcf67396cd
No known key found for this signature in database

@ -2571,8 +2571,8 @@ void FullscreenUI::InputBindingDialog::Start(SettingsInterface* bsi, InputBindin
} }
const float abs_value = std::abs(value); const float abs_value = std::abs(value);
const bool reverse_threshold = const bool reverse_threshold = (key.source_subtype == InputSubclass::ControllerAxis &&
(key.source_subtype == InputSubclass::ControllerAxis && std::abs(initial_value) > 0.5f); std::abs(initial_value) > 0.5f && std::abs(initial_value - min_value) > 0.1f);
for (InputBindingKey& other_key : m_new_bindings) for (InputBindingKey& other_key : m_new_bindings)
{ {

@ -324,8 +324,8 @@ void InputBindingDialog::inputManagerHookCallback(InputBindingKey key, float val
logInputEvent(m_bind_type, key, value, initial_value, min_value); logInputEvent(m_bind_type, key, value, initial_value, min_value);
const float abs_value = std::abs(value); const float abs_value = std::abs(value);
const bool reverse_threshold = const bool reverse_threshold = (key.source_subtype == InputSubclass::ControllerAxis &&
(key.source_subtype == InputSubclass::ControllerAxis && std::abs(initial_value) > 0.5f); std::abs(initial_value) > 0.5f && std::abs(initial_value - min_value) > 0.1f);
for (InputBindingKey& other_key : m_new_bindings) for (InputBindingKey& other_key : m_new_bindings)
{ {

@ -353,8 +353,8 @@ void InputBindingWidget::inputManagerHookCallback(InputBindingKey key, float val
InputBindingDialog::logInputEvent(m_bind_type, key, value, initial_value, min_value); InputBindingDialog::logInputEvent(m_bind_type, key, value, initial_value, min_value);
const float abs_value = std::abs(value); const float abs_value = std::abs(value);
const bool reverse_threshold = const bool reverse_threshold = (key.source_subtype == InputSubclass::ControllerAxis &&
(key.source_subtype == InputSubclass::ControllerAxis && std::abs(initial_value) > 0.5f); std::abs(initial_value) > 0.5f && std::abs(initial_value - min_value) > 0.1f);
for (InputBindingKey& other_key : m_new_bindings) for (InputBindingKey& other_key : m_new_bindings)
{ {

Loading…
Cancel
Save