From cd76008e8146bcf8987b381f95d342db1046df65 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 15 Apr 2024 16:21:53 +0200 Subject: [PATCH] Follow-up ba5e8b87 - Fixed working of the "Delete" button SPE-2237 --- src/slic3r/GUI/wxExtensions.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 3cb671fb02..3c91189bee 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -96,8 +96,27 @@ wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const #ifndef __APPLE__ if (wxAcceleratorEntry* entry = wxAcceleratorEntry::Create(string)) { - entry->SetMenuItem(item); - accelerator_entries_cache().push_back(entry); + + static const std::set special_keys = { + WXK_PAGEUP, + WXK_PAGEDOWN, + WXK_NUMPAD_PAGEDOWN, + WXK_END, + WXK_HOME, + WXK_LEFT, + WXK_UP, + WXK_RIGHT, + WXK_DOWN, + WXK_INSERT, + WXK_DELETE, + }; + + // Check for special keys not included in the table + // see wxMSWKeyboard::WXWORD WXToVK(int wxk, bool *isExtended) + if (std::find(special_keys.begin(), special_keys.end(), entry->GetKeyCode()) == special_keys.end()) { + entry->SetMenuItem(item); + accelerator_entries_cache().push_back(entry); + } } #endif