diff options
Diffstat (limited to 'editor/plugins')
| -rw-r--r-- | editor/plugins/abstract_polygon_2d_editor.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 12 | ||||
| -rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/gradient_editor.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/gradient_texture_2d_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 5 | ||||
| -rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 3 | ||||
| -rw-r--r-- | editor/plugins/polygon_3d_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/script_text_editor.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 5 | ||||
| -rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 5 | ||||
| -rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 4 |
14 files changed, 32 insertions, 28 deletions
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index fd15735e65..fd5ebc423e 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -285,7 +285,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) { if (mb->get_button_index() == MouseButton::LEFT) { if (mb->is_pressed()) { - if (mb->is_ctrl_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) { + if (mb->is_meta_pressed() || mb->is_ctrl_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) { return false; } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 638838bcca..a16d689e3d 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -158,7 +158,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv } // Select node or push a field inside - if (mb.is_valid() && !mb->is_shift_pressed() && !mb->is_ctrl_pressed() && mb->is_pressed() && tool_select->is_pressed() && mb->get_button_index() == MouseButton::LEFT) { + if (mb.is_valid() && !mb->is_shift_pressed() && !mb->is_command_or_control_pressed() && mb->is_pressed() && tool_select->is_pressed() && mb->get_button_index() == MouseButton::LEFT) { selected_transition_from = StringName(); selected_transition_to = StringName(); selected_transition_index = -1; @@ -337,7 +337,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv ABS(box_selecting_from.x - box_selecting_to.x), ABS(box_selecting_from.y - box_selecting_to.y)); - if (mb->is_ctrl_pressed() || mb->is_shift_pressed()) { + if (mb->is_command_or_control_pressed() || mb->is_shift_pressed()) { previous_selected = selected_nodes; } else { selected_nodes.clear(); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 91f403bc49..f62eaee96e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -354,7 +354,7 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsig snap_target[0] = SNAP_TARGET_NONE; snap_target[1] = SNAP_TARGET_NONE; - bool is_snap_active = smart_snap_active ^ Input::get_singleton()->is_key_pressed(Key::CTRL); + bool is_snap_active = smart_snap_active ^ Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL); // Smart snap using the canvas position Vector2 output = p_target; @@ -480,7 +480,7 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsig } real_t CanvasItemEditor::snap_angle(real_t p_target, real_t p_start) const { - if (((smart_snap_active || snap_rotation) ^ Input::get_singleton()->is_key_pressed(Key::CTRL)) && snap_rotation_step != 0) { + if (((smart_snap_active || snap_rotation) ^ Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL)) && snap_rotation_step != 0) { if (snap_relative) { return Math::snapped(p_target - snap_rotation_offset, snap_rotation_step) + snap_rotation_offset + (p_start - (int)(p_start / snap_rotation_step) * snap_rotation_step); } else { @@ -505,7 +505,7 @@ void CanvasItemEditor::shortcut_input(const Ref<InputEvent> &p_ev) { viewport->queue_redraw(); } - if (k->is_pressed() && !k->is_ctrl_pressed() && !k->is_echo() && (grid_snap_active || _is_grid_visible())) { + if (k->is_pressed() && !k->is_command_or_control_pressed() && !k->is_echo() && (grid_snap_active || _is_grid_visible())) { if (multiply_grid_step_shortcut.is_valid() && multiply_grid_step_shortcut->matches_event(p_ev)) { // Multiply the grid size grid_step_multiplier = MIN(grid_step_multiplier + 1, 12); @@ -1924,7 +1924,7 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { Transform2D simple_xform = (viewport->get_transform() * unscaled_transform).affine_inverse() * transform; bool uniform = m->is_shift_pressed(); - bool is_ctrl = m->is_ctrl_pressed(); + bool is_ctrl = m->is_command_or_control_pressed(); Point2 drag_from_local = simple_xform.xform(drag_from); Point2 drag_to_local = simple_xform.xform(drag_to); @@ -5609,7 +5609,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); if (texture != nullptr || scene != nullptr) { bool root_node_selected = EditorNode::get_singleton()->get_editor_selection()->is_selected(EditorNode::get_singleton()->get_edited_scene()); - String desc = TTR("Drag and drop to add as child of current scene's root node.") + "\n" + TTR("Hold Ctrl when dropping to add as child of selected node."); + String desc = TTR("Drag and drop to add as child of current scene's root node.") + "\n" + vformat(TTR("Hold %s when dropping to add as child of selected node."), keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL)); if (!root_node_selected) { desc += "\n" + TTR("Hold Shift when dropping to add as sibling of selected node."); } @@ -5913,7 +5913,7 @@ bool CanvasItemEditorViewport::_only_packed_scenes_selected() const { void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p_data) { bool is_shift = Input::get_singleton()->is_key_pressed(Key::SHIFT); - bool is_ctrl = Input::get_singleton()->is_key_pressed(Key::CTRL); + bool is_ctrl = Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL); bool is_alt = Input::get_singleton()->is_key_pressed(Key::ALT); selected_files.clear(); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 1d3ffc0e3a..37f0ca449d 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -225,7 +225,7 @@ void CurveEdit::gui_input(const Ref<InputEvent> &p_event) { } else if (grabbing == GRAB_NONE) { // Adding a new point. Insert a temporary point for the user to adjust, so it's not in the undo/redo. Vector2 new_pos = get_world_pos(mpos).clamp(Vector2(0.0, curve->get_min_value()), Vector2(1.0, curve->get_max_value())); - if (snap_enabled || mb->is_ctrl_pressed()) { + if (snap_enabled || mb->is_command_or_control_pressed()) { new_pos.x = Math::snapped(new_pos.x, 1.0 / snap_count); new_pos.y = Math::snapped(new_pos.y - curve->get_min_value(), curve->get_range() / snap_count) + curve->get_min_value(); } @@ -276,7 +276,7 @@ void CurveEdit::gui_input(const Ref<InputEvent> &p_event) { // Drag point. Vector2 new_pos = get_world_pos(mpos).clamp(Vector2(0.0, curve->get_min_value()), Vector2(1.0, curve->get_max_value())); - if (snap_enabled || mm->is_ctrl_pressed()) { + if (snap_enabled || mm->is_command_or_control_pressed()) { new_pos.x = Math::snapped(new_pos.x, 1.0 / snap_count); new_pos.y = Math::snapped(new_pos.y - curve->get_min_value(), curve->get_range() / snap_count) + curve->get_min_value(); } diff --git a/editor/plugins/gradient_editor.cpp b/editor/plugins/gradient_editor.cpp index 63dede4850..bcc7d2a004 100644 --- a/editor/plugins/gradient_editor.cpp +++ b/editor/plugins/gradient_editor.cpp @@ -312,7 +312,7 @@ void GradientEditor::gui_input(const Ref<InputEvent> &p_event) { // Snap to "round" coordinates if holding Ctrl. // Be more precise if holding Shift as well. - if (mm->is_ctrl_pressed()) { + if (mm->is_command_or_control_pressed()) { newofs = Math::snapped(newofs, mm->is_shift_pressed() ? 0.025 : 0.1); } else if (mm->is_shift_pressed()) { // Snap to nearest point if holding just Shift. diff --git a/editor/plugins/gradient_texture_2d_editor_plugin.cpp b/editor/plugins/gradient_texture_2d_editor_plugin.cpp index 494d97c45c..5952185cc0 100644 --- a/editor/plugins/gradient_texture_2d_editor_plugin.cpp +++ b/editor/plugins/gradient_texture_2d_editor_plugin.cpp @@ -113,7 +113,7 @@ void GradientTexture2DEdit::gui_input(const Ref<InputEvent> &p_event) { } Vector2 new_pos = (mpos / size).clamp(Vector2(0, 0), Vector2(1, 1)); - if (snap_enabled || mm->is_ctrl_pressed()) { + if (snap_enabled || mm->is_command_or_control_pressed()) { new_pos = new_pos.snapped(Vector2(1.0 / snap_count, 1.0 / snap_count)); } @@ -201,7 +201,7 @@ void GradientTexture2DEdit::_draw() { draw_texture_rect(texture, Rect2(Point2(), size)); // Draw grid snap lines. - if (snap_enabled || (Input::get_singleton()->is_key_pressed(Key::CTRL) && grabbed != HANDLE_NONE)) { + if (snap_enabled || (Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL) && grabbed != HANDLE_NONE)) { const Color line_color = Color(0.5, 0.5, 0.5, 0.5); for (int idx = 0; idx < snap_count + 1; idx++) { diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index c05a6d1392..2215c371d0 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1977,7 +1977,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { nav_mode = NAVIGATION_ORBIT; } else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed() && m->is_shift_pressed()) { nav_mode = NAVIGATION_PAN; - } else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed() && m->is_ctrl_pressed()) { + } else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed() && m->is_command_or_control_pressed()) { nav_mode = NAVIGATION_ZOOM; } else if (nav_scheme == NAVIGATION_MODO && m->is_alt_pressed()) { nav_mode = NAVIGATION_ORBIT; @@ -5244,7 +5244,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p preview_material_label_desc = memnew(Label); preview_material_label_desc->set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_LEFT); preview_material_label_desc->set_offset(Side::SIDE_TOP, -50 * EDSCALE); - preview_material_label_desc->set_text(TTR("Drag and drop to override the material of any geometry node.\nHold Ctrl when dropping to override a specific surface.")); + Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; + preview_material_label_desc->set_text(vformat(TTR("Drag and drop to override the material of any geometry node.\nHold %s when dropping to override a specific surface."), find_keycode_name(key))); preview_material_label_desc->add_theme_color_override("font_color", Color(0.8, 0.8, 0.8, 1)); preview_material_label_desc->add_theme_constant_override("line_spacing", 0); preview_material_label_desc->hide(); diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 40e8482a0b..e1b402475a 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -455,7 +455,7 @@ EditorPlugin::AfterGUIInput Path3DEditorPlugin::forward_3d_gui_input(Camera3D *p set_handle_clicked(false); } - if (mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb->is_ctrl_pressed()))) { + if (mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb->is_command_or_control_pressed()))) { //click into curve, break it down Vector<Vector3> v3a = c->tessellate(); int rc = v3a.size(); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 5ed9f4946d..e700d28afb 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1304,7 +1304,8 @@ Polygon2DEditor::Polygon2DEditor() { uv_button[UV_MODE_CREATE]->set_tooltip_text(TTR("Create Polygon")); uv_button[UV_MODE_CREATE_INTERNAL]->set_tooltip_text(TTR("Create Internal Vertex")); uv_button[UV_MODE_REMOVE_INTERNAL]->set_tooltip_text(TTR("Remove Internal Vertex")); - uv_button[UV_MODE_EDIT_POINT]->set_tooltip_text(TTR("Move Points") + "\n" + TTR("Ctrl: Rotate") + "\n" + TTR("Shift: Move All") + "\n" + TTR("Shift+Ctrl: Scale")); + Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; + uv_button[UV_MODE_EDIT_POINT]->set_tooltip_text(TTR("Move Points") + "\n" + find_keycode_name(key) + TTR(": Rotate") + "\n" + TTR("Shift: Move All") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Shift: Scale")); uv_button[UV_MODE_MOVE]->set_tooltip_text(TTR("Move Polygon")); uv_button[UV_MODE_ROTATE]->set_tooltip_text(TTR("Rotate Polygon")); uv_button[UV_MODE_SCALE]->set_tooltip_text(TTR("Scale Polygon")); diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp index 41672822b2..fa5413787c 100644 --- a/editor/plugins/polygon_3d_editor_plugin.cpp +++ b/editor/plugins/polygon_3d_editor_plugin.cpp @@ -184,7 +184,7 @@ EditorPlugin::AfterGUIInput Polygon3DEditor::forward_3d_gui_input(Camera3D *p_ca case MODE_EDIT: { if (mb->get_button_index() == MouseButton::LEFT) { if (mb->is_pressed()) { - if (mb->is_ctrl_pressed()) { + if (mb->is_command_or_control_pressed()) { if (poly.size() < 3) { EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); undo_redo->create_action(TTR("Edit Poly")); @@ -329,7 +329,7 @@ EditorPlugin::AfterGUIInput Polygon3DEditor::forward_3d_gui_input(Camera3D *p_ca Vector2 cpoint(spoint.x, spoint.y); - if (snap_ignore && !Input::get_singleton()->is_key_pressed(Key::CTRL)) { + if (snap_ignore && !Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL)) { snap_ignore = false; } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 5aaa3365b3..ca80c2e087 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1747,7 +1747,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data Array files = d["files"]; String text_to_drop; - bool preload = Input::get_singleton()->is_key_pressed(Key::CTRL); + bool preload = Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL); for (int i = 0; i < files.size(); i++) { if (i > 0) { text_to_drop += ", "; @@ -1787,7 +1787,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data Array nodes = d["nodes"]; String text_to_drop; - if (Input::get_singleton()->is_key_pressed(Key::CTRL)) { + if (Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL)) { bool use_type = EDITOR_GET("text_editor/completion/add_type_hints"); for (int i = 0; i < nodes.size(); i++) { NodePath np = nodes[i]; diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 3134c0b951..1844358069 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -188,7 +188,7 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) { // Prevent double-toggling the same frame when moving the mouse when the mouse button is still held. frames_toggled_by_mouse_hover.insert(this_idx); - if (mb->is_ctrl_pressed()) { + if (mb->is_command_or_control_pressed()) { frames_selected.erase(this_idx); } else if (!frames_selected.has(this_idx)) { frames_selected.insert(this_idx, selected_count); @@ -255,6 +255,7 @@ void SpriteFramesEditor::_sheet_scroll_input(const Ref<InputEvent> &p_event) { // Zoom in/out using Ctrl + mouse wheel. This is done on the ScrollContainer // to allow performing this action anywhere, even if the cursor isn't // hovering the texture in the workspace. + // keep CTRL and not CMD_OR_CTRL as CTRL is expected even on MacOS. if (mb->get_button_index() == MouseButton::WHEEL_UP && mb->is_pressed() && mb->is_ctrl_pressed()) { _sheet_zoom_on_position(scale_ratio, mb->get_position()); // Don't scroll up after zooming in. @@ -1485,7 +1486,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da if (String(d["type"]) == "files") { Vector<String> files = d["files"]; - if (Input::get_singleton()->is_key_pressed(Key::CTRL)) { + if (Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL)) { _prepare_sprite_sheet(files[0]); } else { _file_load_request(files, at_pos); diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index d5011380d3..b3ed98c58d 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -2217,7 +2217,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { paint_tool_button->set_toggle_mode(true); paint_tool_button->set_button_group(tool_buttons_group); paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D)); - paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + TTR("Shift+Ctrl: Draw rectangle.")); + paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Shift: Draw rectangle.")); paint_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(paint_tool_button); viewport_shortcut_buttons.push_back(paint_tool_button); @@ -2263,7 +2263,8 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { picker_button->set_flat(true); picker_button->set_toggle_mode(true); picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P)); - picker_button->set_tooltip_text(TTR("Alternatively hold Ctrl with other tools to pick tile.")); + Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; + picker_button->set_tooltip_text(vformat(TTR("Alternatively hold %s with other tools to pick tile."), find_keycode_name(key))); picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); tools_settings->add_child(picker_button); viewport_shortcut_buttons.push_back(picker_button); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 1485ee9115..4037655e2c 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -1202,7 +1202,7 @@ void TileSetAtlasSourceEditor::_tile_atlas_control_gui_input(const Ref<InputEven if (tools_button_group->get_pressed_button() == tool_setup_atlas_source_button) { if (tools_settings_erase_button->is_pressed()) { // Erasing - if (mb->is_ctrl_pressed() || mb->is_shift_pressed()) { + if (mb->is_command_or_control_pressed() || mb->is_shift_pressed()) { // Remove tiles using rect. // Setup the dragging info. @@ -1241,7 +1241,7 @@ void TileSetAtlasSourceEditor::_tile_atlas_control_gui_input(const Ref<InputEven // Create a tile. tile_set_atlas_source->create_tile(coords); } - } else if (mb->is_ctrl_pressed()) { + } else if (mb->is_command_or_control_pressed()) { // Create tiles using rect. drag_type = DRAG_TYPE_CREATE_TILES_USING_RECT; drag_start_mouse_pos = mouse_local_pos; |
