MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / accumulate

Method accumulate

core/input/input_event.cpp:1024–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022}
1023
1024bool InputEventMouseMotion::accumulate(const Ref<InputEvent> &p_event) {
1025 Ref<InputEventMouseMotion> motion = p_event;
1026 if (motion.is_null()) {
1027 return false;
1028 }
1029
1030 if (get_window_id() != motion->get_window_id()) {
1031 return false;
1032 }
1033
1034 if (is_canceled() != motion->is_canceled()) {
1035 return false;
1036 }
1037
1038 if (is_pressed() != motion->is_pressed()) {
1039 return false;
1040 }
1041
1042 if (get_button_mask() != motion->get_button_mask()) {
1043 return false;
1044 }
1045
1046 if (is_shift_pressed() != motion->is_shift_pressed()) {
1047 return false;
1048 }
1049
1050 if (is_ctrl_pressed() != motion->is_ctrl_pressed()) {
1051 return false;
1052 }
1053
1054 if (is_alt_pressed() != motion->is_alt_pressed()) {
1055 return false;
1056 }
1057
1058 if (is_meta_pressed() != motion->is_meta_pressed()) {
1059 return false;
1060 }
1061
1062 set_position(motion->get_position());
1063 set_global_position(motion->get_global_position());
1064 set_velocity(motion->get_velocity());
1065 set_screen_velocity(motion->get_screen_velocity());
1066 relative += motion->get_relative();
1067 screen_relative += motion->get_relative_screen_position();
1068
1069 return true;
1070}
1071
1072void InputEventMouseMotion::_bind_methods() {
1073 ClassDB::bind_method(D_METHOD("set_tilt", "tilt"), &InputEventMouseMotion::set_tilt);

Callers 2

parse_input_eventMethod · 0.45
test_input_event.hFile · 0.45

Calls 15

is_canceledMethod · 0.80
is_shift_pressedMethod · 0.80
is_alt_pressedMethod · 0.80
is_meta_pressedMethod · 0.80
get_screen_velocityMethod · 0.80
get_relativeMethod · 0.80
is_nullMethod · 0.45
get_window_idMethod · 0.45
is_pressedMethod · 0.45
get_button_maskMethod · 0.45
is_ctrl_pressedMethod · 0.45

Tested by

no test coverage detected