summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-11-10 21:35:07 +0100
committerGitHub <noreply@github.com>2018-11-10 21:35:07 +0100
commit8c45282d21155009e5b239b8df610661409981e6 (patch)
tree32333a0771087186fadf05ff3b3fd46f77652065 /core
parent87d27e1250c4be1406b15244901cefb6738a6709 (diff)
parent1b0c7515ffe2bbb0cb8cb08bf9d21f68d4648d89 (diff)
Merge pull request #23621 from workless/allow_strength_in_action_press
Allow to specify a custom strength when calling Input.action_press(),…
Diffstat (limited to 'core')
-rw-r--r--core/os/input.cpp2
-rw-r--r--core/os/input.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 4cd1f0b24a..1a24258a10 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -86,7 +86,7 @@ void Input::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_mouse_mode", "mode"), &Input::set_mouse_mode);
ClassDB::bind_method(D_METHOD("get_mouse_mode"), &Input::get_mouse_mode);
ClassDB::bind_method(D_METHOD("warp_mouse_position", "to"), &Input::warp_mouse_position);
- ClassDB::bind_method(D_METHOD("action_press", "action"), &Input::action_press);
+ ClassDB::bind_method(D_METHOD("action_press", "action", "strength"), &Input::action_press);
ClassDB::bind_method(D_METHOD("action_release", "action"), &Input::action_release);
ClassDB::bind_method(D_METHOD("set_default_cursor_shape", "shape"), &Input::set_default_cursor_shape, DEFVAL(CURSOR_ARROW));
ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "shape", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2()));
diff --git a/core/os/input.h b/core/os/input.h
index db523d6789..dc2c213db2 100644
--- a/core/os/input.h
+++ b/core/os/input.h
@@ -113,7 +113,7 @@ public:
virtual Vector3 get_magnetometer() const = 0;
virtual Vector3 get_gyroscope() const = 0;
- virtual void action_press(const StringName &p_action) = 0;
+ virtual void action_press(const StringName &p_action, float p_strength = 1.f) = 0;
virtual void action_release(const StringName &p_action) = 0;
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;