summaryrefslogtreecommitdiffstats
path: root/core/input/input_event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/input/input_event.cpp')
-rw-r--r--core/input/input_event.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index 46f07fe041..d91a7bf5a5 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -1096,6 +1096,15 @@ String InputEventJoypadMotion::to_string() {
return vformat("InputEventJoypadMotion: axis=%d, axis_value=%.2f", axis, axis_value);
}
+Ref<InputEventJoypadMotion> InputEventJoypadMotion::create_reference(JoyAxis p_axis, float p_value) {
+ Ref<InputEventJoypadMotion> ie;
+ ie.instantiate();
+ ie->set_axis(p_axis);
+ ie->set_axis_value(p_value);
+
+ return ie;
+}
+
void InputEventJoypadMotion::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_axis", "axis"), &InputEventJoypadMotion::set_axis);
ClassDB::bind_method(D_METHOD("get_axis"), &InputEventJoypadMotion::get_axis);