Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.cpp (C++)

Code before:
// to capture and wrap mouse events outside the control.
void Node3DEditorViewport::input(const Ref<InputEvent> &p_event) {
	ERR_FAIL_COND(!_edit.instant);
	Ref<InputEventMouseMotion> m = p_event;

	if (m.is_valid()) {
		_edit.mouse_pos += _get_warped_mouse_motion(p_event);
		update_transform(_get_key_modifier(m) == Key::SHIFT);
	}
}

void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
	if (previewing || get_viewport()->gui_get_drag_data()) {
		return; //do NONE
	}

	EditorPlugin::AfterGUIInput after = EditorPlugin::AFTER_GUI_INPUT_PASS;
	{
		EditorNode *en = EditorNode::get_singleton();
		EditorPluginList *force_input_forwarding_list = en->get_editor_plugins_force_input_forwarding();
		if (!force_input_forwarding_list->is_empty()) {
			EditorPlugin::AfterGUIInput discard = force_input_forwarding_list->forward_3d_gui_input(camera, p_event, true);
			if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
				return;
			}
			if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
				after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
			}
		}
	}
	{
		EditorNode *en = EditorNode::get_singleton();
		EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
		if (!over_plugin_list->is_empty()) {
			EditorPlugin::AfterGUIInput discard = over_plugin_list->forward_3d_gui_input(camera, p_event, false);
			if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
				return;
			}
			if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
				after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
			}
		}
	}

	Ref<InputEventMouseButton> b = p_event;

	if (b.is_valid()) {
		emit_signal(SNAME("clicked"), this);

		const real_t zoom_factor = 1 + (ZOOM_FREELOOK_MULTIPLIER - 1) * b->get_factor();
		switch (b->get_button_index()) {

Review comment (suggestion):
```suggestion
					if (orbit_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_2")) {
						break;
					} else if (pan_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_2")) {
						break;
					} else if (zoom_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_2")) {
```

Code after:
// to capture and wrap mouse events outside the control.
void Node3DEditorViewport::input(const Ref<InputEvent> &p_event) {
	ERR_FAIL_COND(!_edit.instant);
	Ref<InputEventMouseMotion> m = p_event;

	if (m.is_valid()) {
		_edit.mouse_pos += _get_warped_mouse_motion(p_event);
		update_transform(_get_key_modifier(m) == Key::SHIFT);
	}
}

void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
	if (previewing || get_viewport()->gui_get_drag_data()) {
		return; //do NONE
	}

	EditorPlugin::AfterGUIInput after = EditorPlugin::AFTER_GUI_INPUT_PASS;
	{
		EditorNode *en = EditorNode::get_singleton();
		EditorPluginList *force_input_forwarding_list = en->get_editor_plugins_force_input_forwarding();
		if (!force_input_forwarding_list->is_empty()) {
			EditorPlugin::AfterGUIInput discard = force_input_forwarding_list->forward_3d_gui_input(camera, p_event, true);
			if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
				return;
			}
			if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
				after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
			}
		}
	}
	{
		EditorNode *en = EditorNode::get_singleton();
		EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
		if (!over_plugin_list->is_empty()) {
			EditorPlugin::AfterGUIInput discard = over_plugin_list->forward_3d_gui_input(camera, p_event, false);
			if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
				return;
			}
			if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
				after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
			}
		}
	}

	Ref<InputEventMouseButton> b = p_event;

	if (b.is_valid()) {
		emit_signal(SNAME("clicked"), this);

		ViewportNavMouseButton orbit_mouse_preference = (ViewportNavMouseButton)EDITOR_GET("editors/3d/navigation/orbit_mouse_button").operator int();
		ViewportNavMouseButton pan_mouse_preference = (ViewportNavMouseButton)EDITOR_GET("editors/3d/navigation/pan_mouse_button").operator int();