From 8ece6dff6a0d8c63cb1972f3d0da7461e1575796 Mon Sep 17 00:00:00 2001 From: svdijk Date: Thu, 18 May 2017 20:44:15 +0200 Subject: [PATCH] Menu: Never treat keys with no "Char" as hotkeys. --- wadsrc/static/zscript/menu/listmenu.txt | 4 ++-- wadsrc/static/zscript/menu/listmenuitems.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/menu/listmenu.txt b/wadsrc/static/zscript/menu/listmenu.txt index 9bca2d5af..37d00f6e0 100644 --- a/wadsrc/static/zscript/menu/listmenu.txt +++ b/wadsrc/static/zscript/menu/listmenu.txt @@ -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++) { diff --git a/wadsrc/static/zscript/menu/listmenuitems.txt b/wadsrc/static/zscript/menu/listmenuitems.txt index 5b4a4e549..59bff9f61 100644 --- a/wadsrc/static/zscript/menu/listmenuitems.txt +++ b/wadsrc/static/zscript/menu/listmenuitems.txt @@ -199,7 +199,7 @@ class ListMenuItemSelectable : ListMenuItem override bool CheckHotkey(int c) { - return c == mHotkey; + return c > 0 && c == mHotkey; } override bool Activate()