You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Add double_tap attribute to InputEventScreenTouch
This provides parity with the `InputEventMouseButton` allowing for proper conversion between the two events.
This commit is contained in:
@@ -519,6 +519,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||
touch_event.instantiate();
|
||||
touch_event->set_pressed(mb->is_pressed());
|
||||
touch_event->set_position(mb->get_position());
|
||||
touch_event->set_double_tap(mb->is_double_click());
|
||||
event_dispatch_function(touch_event);
|
||||
}
|
||||
}
|
||||
@@ -580,6 +581,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||
button_event->set_global_position(st->get_position());
|
||||
button_event->set_pressed(st->is_pressed());
|
||||
button_event->set_button_index(MouseButton::LEFT);
|
||||
button_event->set_double_click(st->is_double_tap());
|
||||
if (st->is_pressed()) {
|
||||
button_event->set_button_mask(MouseButton(mouse_button_mask | MouseButton::MASK_LEFT));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user