mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-15 10:40:44 +01:00
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:
3 files changed
+6
-6
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user