From c6f28ed62b5b24033439e6c5d8517883d93c5f53 Mon Sep 17 00:00:00 2001
From: Nick H <62965063+SirQuartz@users.noreply.github.com>
Date: Fri, 2 Jul 2021 00:02:28 -0400
Subject: [PATCH] Add `get_dead_zone()` method to `InputMap`
This commit adds a new method to the `InputMap`, allowing the user to get the value of an action's dead zone as a float.
---
core/input/input_map.cpp | 1 +
doc/classes/InputMap.xml | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index 52dc561546be..b5f067d4993b 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -45,6 +45,7 @@ void InputMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("erase_action", "action"), &InputMap::erase_action);
ClassDB::bind_method(D_METHOD("action_set_deadzone", "action", "deadzone"), &InputMap::action_set_deadzone);
+ ClassDB::bind_method(D_METHOD("action_get_deadzone", "action"), &InputMap::action_get_deadzone);
ClassDB::bind_method(D_METHOD("action_add_event", "action", "event"), &InputMap::action_add_event);
ClassDB::bind_method(D_METHOD("action_has_event", "action", "event"), &InputMap::action_has_event);
ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event"), &InputMap::action_erase_event);
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index 0fb18d8e81cd..3948ab0208c8 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -41,6 +41,15 @@
Removes all events from an action.
+
+
+
+
+
+
+ Returns a deadzone value for the action.
+
+