summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input.cpp16
-rw-r--r--core/input/input_event.cpp16
2 files changed, 16 insertions, 16 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp
index 6e98b596d7..be536aa730 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -500,7 +500,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) {
Ref<InputEventScreenTouch> touch_event;
- touch_event.instance();
+ touch_event.instantiate();
touch_event->set_pressed(mb->is_pressed());
touch_event->set_position(mb->get_position());
event_dispatch_function(touch_event);
@@ -517,7 +517,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) {
Ref<InputEventScreenDrag> drag_event;
- drag_event.instance();
+ drag_event.instantiate();
drag_event->set_position(mm->get_position());
drag_event->set_relative(mm->get_relative());
@@ -555,7 +555,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
if (translate) {
Ref<InputEventMouseButton> button_event;
- button_event.instance();
+ button_event.instantiate();
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
button_event->set_position(st->get_position());
@@ -582,7 +582,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) {
Ref<InputEventMouseMotion> motion_event;
- motion_event.instance();
+ motion_event.instantiate();
motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
motion_event->set_position(sd->get_position());
@@ -787,7 +787,7 @@ void Input::ensure_touch_mouse_raised() {
mouse_from_touch_index = -1;
Ref<InputEventMouseButton> button_event;
- button_event.instance();
+ button_event.instantiate();
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
button_event->set_position(mouse_pos);
@@ -821,7 +821,7 @@ void Input::set_default_cursor_shape(CursorShape p_shape) {
// The default shape is set in Viewport::_gui_input_event. To instantly
// see the shape in the viewport we need to trigger a mouse motion event.
Ref<InputEventMouseMotion> mm;
- mm.instance();
+ mm.instantiate();
mm->set_position(mouse_pos);
mm->set_global_position(mouse_pos);
parse_input_event(mm);
@@ -1031,7 +1031,7 @@ void Input::joy_hat(int p_device, int p_val) {
void Input::_button_event(int p_device, int p_index, bool p_pressed) {
Ref<InputEventJoypadButton> ievent;
- ievent.instance();
+ ievent.instantiate();
ievent->set_device(p_device);
ievent->set_button_index(p_index);
ievent->set_pressed(p_pressed);
@@ -1041,7 +1041,7 @@ void Input::_button_event(int p_device, int p_index, bool p_pressed) {
void Input::_axis_event(int p_device, int p_axis, float p_value) {
Ref<InputEventJoypadMotion> ievent;
- ievent.instance();
+ ievent.instantiate();
ievent->set_device(p_device);
ievent->set_axis(p_axis);
ievent->set_axis_value(p_value);
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index 72fb409b63..14762f955c 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -375,7 +375,7 @@ String InputEventKey::to_string() {
Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) {
Ref<InputEventKey> ie;
- ie.instance();
+ ie.instantiate();
ie->set_keycode(p_keycode & KEY_CODE_MASK);
ie->set_unicode(p_keycode & KEY_CODE_MASK);
@@ -545,7 +545,7 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co
Vector2 l = p_xform.xform(get_position() + p_local_ofs);
Ref<InputEventMouseButton> mb;
- mb.instance();
+ mb.instantiate();
mb->set_device(get_device());
mb->set_window_id(get_window_id());
@@ -731,7 +731,7 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co
Vector2 s = p_xform.basis_xform(get_speed());
Ref<InputEventMouseMotion> mm;
- mm.instance();
+ mm.instantiate();
mm->set_device(get_device());
mm->set_window_id(get_window_id());
@@ -1048,7 +1048,7 @@ String InputEventJoypadButton::to_string() {
Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) {
Ref<InputEventJoypadButton> ie;
- ie.instance();
+ ie.instantiate();
ie->set_button_index(p_btn_index);
return ie;
@@ -1097,7 +1097,7 @@ bool InputEventScreenTouch::is_pressed() const {
Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
Ref<InputEventScreenTouch> st;
- st.instance();
+ st.instantiate();
st->set_device(get_device());
st->set_window_id(get_window_id());
st->set_index(index);
@@ -1170,7 +1170,7 @@ Vector2 InputEventScreenDrag::get_speed() const {
Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
Ref<InputEventScreenDrag> sd;
- sd.instance();
+ sd.instantiate();
sd->set_device(get_device());
sd->set_window_id(get_window_id());
@@ -1325,7 +1325,7 @@ real_t InputEventMagnifyGesture::get_factor() const {
Ref<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
Ref<InputEventMagnifyGesture> ev;
- ev.instance();
+ ev.instantiate();
ev->set_device(get_device());
ev->set_window_id(get_window_id());
@@ -1365,7 +1365,7 @@ Vector2 InputEventPanGesture::get_delta() const {
Ref<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
Ref<InputEventPanGesture> ev;
- ev.instance();
+ ev.instantiate();
ev->set_device(get_device());
ev->set_window_id(get_window_id());