From f4cee951ca5e5cd00d66595b9cda7b28a79f2bb1 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 5 Aug 2020 11:26:25 -0700 Subject: [PATCH] ^X on MacOSX Qt Add Michael's fix for control+x. The enum name of the argument suggests that option+x should have been sending control characters but that wasn't the case for me. Before this fix, both control+x and option+x behaved like dead keys, not transmitting anything for nethack to use. After this fix, control+x sends ^X as desired but option+x is still dead. --- doc/fixes37.0 | 3 ++- win/Qt/qt_main.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 1c6f4e479..7dcf64596 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.271 $ $NHDT-Date: 1596494524 2020/08/03 22:42:04 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.272 $ $NHDT-Date: 1596651973 2020/08/05 18:26:13 $ General Fixes and Modified Features ----------------------------------- @@ -350,6 +350,7 @@ Qt: switch to fixed-width font for menus Qt: don't disable [cancel] button when viewing inventory or other pick-none menus; ESC works to dismiss those and [cancel] should be the same Qt: bring status conditions up to 3.6 levels but new ones lack pictures +Qt: fix control key on OSX tiles: add indicator of thonged portion to aklys tile tty: role and race selection menus weren't filtering out potential choices which got excluded by OPTIONS=align:!lawful or !neutral or !chaotic diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index 241c7a801..4968fc7bf 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -520,6 +520,11 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) : QCoreApplication::setOrganizationName("The NetHack DevTeam"); QCoreApplication::setOrganizationDomain("nethack.org"); QCoreApplication::setApplicationName("NetHack"); +#ifdef MACOSX + /* without this, neither control+x nor option+x do anything; + with it, control+x is ^X and option+x still does nothing */ + QCoreApplication::setAttribute(Qt::AA_MacDontSwapCtrlAndMeta); +#endif setWindowTitle("Qt NetHack"); if ( qt_compact_mode )