From: Alex Kompel Date: Sun, 18 Mar 2018 19:52:30 +0000 (-0700) Subject: win32-gui: Do not auto-assign non-alphabet accelerator characters to menu items.... X-Git-Tag: NetHack-3.6.1_RC01~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60454b4f92a1f90ec6752a5e36e2f789c3969b25;p=nethack 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 %, ... --- 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')