Skip to content

Commit

Permalink
Fix missing shortcuts from key bindings.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
denisfa authored and rkitover committed Jun 23, 2019
1 parent 69b581f commit dfa4fec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wx/widgets/keyedit.cpp
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/wx/xrc/MainMenu.xrc
Expand Up @@ -334,6 +334,18 @@
<object class="wxMenuItem" name="SoundConfigure">
<label>_Configure ...</label>
</object>
<object class="wxMenuItem" name="IncreaseVolume">
<label>_Increase volume</label>
<checkable>0</checkable>
</object>
<object class="wxMenuItem" name="DecreaseVolume">
<label>_Decrease volume</label>
<checkable>0</checkable>
</object>
<object class="wxMenuItem" name="ToggleSound">
<label>_Toggle sound</label>
<checkable>0</checkable>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="GBASoundInterpolation">
<label>_GBA sound interpolation</label>
Expand Down

0 comments on commit dfa4fec

Please sign in to comment.