From 8cc7580474cab20ad6ad8f0dfd5fb6aa1898903c Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 10 Aug 2020 18:11:12 -0700 Subject: [PATCH] Qt info->annotate The core is mapping #annotate to ^N, which has no effect when number_pad is Off. The Qt menu setup saw it as the way to run that command, which will only work when number_pad is On. This fixes the menu and didn't break the large subset of other menu commands I've tried, but I haven't gotten through half of them yet. --- win/Qt/qt_main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index 32c791a02..6fc39047e 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -702,8 +702,16 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) : actchar[0] = actchar[1] = '\0'; if (item[i].funct) { actchar[0] = cmd_from_func(item[i].funct); - /* M-c won't work */ - if ((actchar[0] & 0x7f) != actchar[0]) + if (actchar[0] + /* M-c won't work; translation between character + sets by the QString class can classify such + characters as erroneous and change them to '?' */ + && ((actchar[0] & 0x7f) != actchar[0] + /* the vi movement keys won't work reliably + because toggling number_pad affects them but + doesn't redo these menus */ + || strchr("hjklyubnHJKLYUBN", actchar[0]) + || strchr("hjklyubn", (actchar[0] | 0x60)))) actchar[0] = '\0'; } if (actchar[0] && !qt_compact_mode)