From e22137e20eefaf50ebd1eb77297368cf0c6cde05 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Thu, 27 Mar 2025 14:55:19 +0800 Subject: [PATCH] FIX:The text tool on Mac cannot input uppercase D And modify shift+d to ctrl+shift+d jira: github 6222 Change-Id: Iedf69c98fb882326cb73866af77f02883b8ebe64 --- src/imgui/imstb_truetype.h | 2 ++ src/slic3r/GUI/GLCanvas3D.cpp | 21 ++++++++++----------- src/slic3r/GUI/KBShortcutsDialog.cpp | 2 +- src/slic3r/GUI/MainFrame.cpp | 7 ++++--- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/imgui/imstb_truetype.h b/src/imgui/imstb_truetype.h index c35d7456d..de3c3139c 100644 --- a/src/imgui/imstb_truetype.h +++ b/src/imgui/imstb_truetype.h @@ -1556,7 +1556,9 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep return 0; // not found } // @TODO +#ifndef __APPLE__ STBTT_assert(0); +#endif return 0; } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 0d4a81c89..b4d3c2bbb 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3518,6 +3518,16 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) return; if ((evt.GetModifiers() & ctrlMask) != 0) { + if ((evt.GetModifiers() & shiftMask) != 0) { + switch (keyCode) { + case 'd': + case 'D': + case WXK_CONTROL_D: { + post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL)); + return; + } + } + } // CTRL is pressed switch (keyCode) { #ifdef __APPLE__ @@ -3646,17 +3656,6 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) default: evt.Skip(); } } else { - if ((evt.GetModifiers() & shiftMask) != 0) { - switch (keyCode) { - - case 'd': - case 'D': - case WXK_CONTROL_D: - post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL)); - return; - } - - } auto obj_list = wxGetApp().obj_list(); switch (keyCode) { diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index d9652003f..2535f449a 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -251,7 +251,7 @@ void KBShortcutsDialog::fill_shortcuts() {ctrl + "6", L("Camera Angle - Right side")}, {ctrl + "A", L("Select all objects")}, - {L("Shift+D"), L("Delete all")}, + {ctrl + L("Shift+D"), L("Delete all")}, {ctrl + "Z", L("Undo")}, {ctrl + "Y", L("Redo")}, { "M", L("Gizmo move") }, diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index b76af6e6e..63447b7dd 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -2618,11 +2618,11 @@ void MainFrame::init_menubar_as_editor() _L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); }, "menu_paste", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this); // BBS Delete selected - append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\t" + _L("Del"), + append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\tDelete", _L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); }, "menu_remove", nullptr, [this](){return can_delete(); }, this); //BBS: delete all - append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + _L("Shift+") + "D", + append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + _L("Shift+") + "D", _L("Deletes all objects"),[this](wxCommandEvent&) { m_plater->delete_all_objects_from_model(); }, "menu_remove", nullptr, [this](){return can_delete_all(); }, this); editMenu->AppendSeparator(); @@ -2704,10 +2704,11 @@ void MainFrame::init_menubar_as_editor() "", nullptr, [this](){return can_delete(); }, this); #endif //BBS: delete all - append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + _L("Shift+") + "D", + append_menu_item(editMenu, wxID_ANY, _L("Delete all") + "\t" + ctrl + _L("Shift+") + "D", _L("Deletes all objects"),[this, handle_key_event](wxCommandEvent&) { wxKeyEvent e; e.SetEventType(wxEVT_KEY_DOWN); + e.SetShiftDown(true); e.SetControlDown(true); e.m_keyCode = 'D'; if (handle_key_event(e)) {