Follow-up ba5e8b87 - Fixed working of the "Delete" button

SPE-2237
This commit is contained in:
YuSanka 2024-04-15 16:21:53 +02:00 committed by Lukas Matena
parent 2c0f826d89
commit cd76008e81

View File

@ -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<int> 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