diff --git a/project/addons/terrain_3d/editor.gd b/project/addons/terrain_3d/editor.gd index 23ba0bafe..6dc70692b 100644 --- a/project/addons/terrain_3d/editor.gd +++ b/project/addons/terrain_3d/editor.gd @@ -259,8 +259,22 @@ func _forward_3d_gui_input(p_viewport_camera: Camera3D, p_event: InputEvent) -> if p_event.get_button_index() == MOUSE_BUTTON_RIGHT and p_event.is_released(): ui.last_rmb_time = Time.get_ticks_msec() ui.update_decal() - - if p_event.get_button_index() == MOUSE_BUTTON_LEFT: + + # Fetch the alternate key binding setting + var use_rmb = editor_settings.get_setting("config/alternate_key_binding") + + # If alternate keybinding is enabled, use RMB instead of ALT + LMB + if use_rmb and p_event.get_button_index() == MOUSE_BUTTON_RIGHT: + if p_event.is_pressed(): + if not editor.is_operating(): + editor.start_operation(mouse_global_position) + editor.operate(mouse_global_position, p_viewport_camera.rotation.y) + return AFTER_GUI_INPUT_STOP + elif editor.is_operating() and p_event.is_released(): + editor.stop_operation() + return AFTER_GUI_INPUT_STOP + + elif not use_rmb and p_event.get_button_index() == MOUSE_BUTTON_LEFT: if p_event.is_pressed(): if Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT): return AFTER_GUI_INPUT_STOP