From dfa4fec3d5f2a4caa7ac07c965af92410e34d668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Tue, 11 Jun 2019 19:52:00 -0300 Subject: [PATCH] Fix missing shortcuts from key bindings. Correct set WXK_NUMPAD_{ADD,SUBTRACT} for default volume controls and enable users to change it via menu "Options > Key Shortcuts". Also allow users to use both these buttons for other input. --- src/wx/widgets/keyedit.cpp | 6 ++++-- src/wx/xrc/MainMenu.xrc | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/wx/widgets/keyedit.cpp b/src/wx/widgets/keyedit.cpp index 0fb0994a7..517eb7874 100644 --- a/src/wx/widgets/keyedit.cpp +++ b/src/wx/widgets/keyedit.cpp @@ -124,10 +124,12 @@ wxString wxKeyTextCtrl::ToString(int mod, int key) #endif - if (s.empty() || (key != wxT('-') && s[s.size() - 1] == wxT('-')) - || (key != wxT('+') && s[s.size() - 1] == wxT('+'))) + if (s.empty() || (key != wxT('-') && s[s.size() - 1] == wxT('-') && s != wxT("Num -")) + || (key != wxT('+') && s[s.size() - 1] == wxT('+') && s != wxT("Num +"))) + { // bad key combo; probably also generates an assertion in wx return wxEmptyString; + } // hacky workaround for bug in wx 3.1+ not parsing key display names, or // parsing modifiers that aren't a combo correctly diff --git a/src/wx/xrc/MainMenu.xrc b/src/wx/xrc/MainMenu.xrc index 05d0b461e..b5bf9cffd 100644 --- a/src/wx/xrc/MainMenu.xrc +++ b/src/wx/xrc/MainMenu.xrc @@ -334,6 +334,18 @@ + + + 0 + + + + 0 + + + + 0 +