Skip to content

Commit 672fe24

Browse files
committed
Input: Change default deadzone back to 0.5 for ui_* actions and axis pressed state
Fixes #103360. Partial revert of changes in #97281 and #99135.
1 parent 53faed5 commit 672fe24

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

core/config/project_settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ void ProjectSettings::_add_builtin_input_map() {
14391439
}
14401440

14411441
Dictionary action;
1442-
action["deadzone"] = Variant(InputMap::DEFAULT_DEADZONE);
1442+
action["deadzone"] = Variant(InputMap::DEFAULT_TOGGLE_DEADZONE);
14431443
action["events"] = events;
14441444

14451445
String action_name = "input/" + E.key;

core/input/input_event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ JoyAxis InputEventJoypadMotion::get_axis() const {
11041104

11051105
void InputEventJoypadMotion::set_axis_value(float p_value) {
11061106
axis_value = p_value;
1107-
pressed = Math::abs(axis_value) >= InputMap::DEFAULT_DEADZONE;
1107+
pressed = Math::abs(axis_value) >= InputMap::DEFAULT_TOGGLE_DEADZONE;
11081108
emit_changed();
11091109
}
11101110

core/input/input_map.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class InputMap : public Object {
5555
};
5656

5757
static constexpr float DEFAULT_DEADZONE = 0.2f;
58+
// Keep bigger deadzone for toggle actions (default `ui_*` actions, axis `pressed`) (GH-103360).
59+
static constexpr float DEFAULT_TOGGLE_DEADZONE = 0.5f;
5860

5961
private:
6062
static InputMap *singleton;

0 commit comments

Comments
 (0)