summaryrefslogtreecommitdiff
path: root/core/os/input_event.cpp
diff options
context:
space:
mode:
authorGilles Roudiere <gilles.roudiere@gmail.com>2018-04-18 21:38:52 +0200
committerGilles Roudiere <gilles.roudiere@gmail.com>2018-04-18 21:38:52 +0200
commit7e89dc432c8781114f4855d6d2f24675a5a1ce5f (patch)
treec872f67e4b5fe9fd4d3bb9f2943a3d40c48c0371 /core/os/input_event.cpp
parent9ce8d8ddda35cda781364e9b648325a2953d3f63 (diff)
Fixes left/up axis not mappable as actions
Diffstat (limited to 'core/os/input_event.cpp')
-rw-r--r--core/os/input_event.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index bdb61cbfd9..5003be77ab 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -656,10 +656,10 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event, bool *
if (jm.is_null())
return false;
- bool match = (axis == jm->axis && ((axis_value < 0) == (jm->axis_value < 0) || jm->axis_value == 0));
+ bool match = (axis == jm->axis && (((axis_value < 0) == (jm->axis_value < 0)) || jm->axis_value == 0));
if (match) {
if (p_pressed != NULL)
- *p_pressed = Math::abs(jm->get_axis_value() >= p_deadzone);
+ *p_pressed = Math::abs(jm->get_axis_value()) >= p_deadzone;
if (p_strength != NULL)
*p_strength = (*p_pressed) ? Math::inverse_lerp(p_deadzone, 1.0f, Math::abs(jm->get_axis_value())) : 0.0f;
}