Qt: Require non-zero displacement for reverse axis binding

Should hopefully work around controllers with digital triggers getting
flagged as inverted bindings.
This commit is contained in:
Stenzek committed 2025-09-22 16:18:16 +10:00
1 parent 055caf5cbe
commit fcf67396cd
3 files changed
+6 -6

No files matched your search

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