From 60454b4f92a1f90ec6752a5e36e2f789c3969b25 Mon Sep 17 00:00:00 2001 From: Alex Kompel Date: Sun, 18 Mar 2018 12:52:30 -0700 Subject: [PATCH] win32-gui: Do not auto-assign non-alphabet accelerator characters to menu items. Picking up pile that contains gold forces accelerators to start with $ so the next one becomes %, ... --- win/win32/mhmenu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 6bdea0a2f..b541af305 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -160,10 +160,11 @@ mswin_menu_window_select_menu(HWND hWnd, int how, MENU_ITEM_P **_selected, ap = data->menu.gacc; for (i = 0; i < data->menu.size; i++) { if (data->menu.items[i].accelerator != 0) { - next_char = (char) (data->menu.items[i].accelerator + 1); + if (isalpha(data->menu.items[i].accelerator)) { + next_char = (char)(data->menu.items[i].accelerator + 1); + } } else if (NHMENU_IS_SELECTABLE(data->menu.items[i])) { - if ((next_char >= 'a' && next_char <= 'z') - || (next_char >= 'A' && next_char <= 'Z')) { + if (isalpha(next_char)) { data->menu.items[i].accelerator = next_char; } else { if (next_char > 'z')