Skip to content

Commit

Permalink
Menu: Never treat keys with no "Char" as hotkeys.
Browse files Browse the repository at this point in the history
  • Loading branch information
svdijk authored and coelckers committed May 18, 2017
1 parent 4b8f421 commit 8ece6df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/menu/listmenu.txt
Expand Up @@ -106,11 +106,11 @@ class ListMenu : Menu

override bool OnUIEvent(UIEvent ev)
{
if (ev.Type == UIEvent.Type_KeyDown)
if (ev.Type == UIEvent.Type_KeyDown && ev.KeyChar > 0)
{
// tolower
int ch = ev.KeyChar;
ch = ch >= 65 && ch <91? ch + 32 : ch;
ch = ch >= 65 && ch < 91 ? ch + 32 : ch;

for(int i = mDesc.mSelectedItem + 1; i < mDesc.mItems.Size(); i++)
{
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/menu/listmenuitems.txt
Expand Up @@ -199,7 +199,7 @@ class ListMenuItemSelectable : ListMenuItem

override bool CheckHotkey(int c)
{
return c == mHotkey;
return c > 0 && c == mHotkey;
}

override bool Activate()
Expand Down

0 comments on commit 8ece6df

Please sign in to comment.