]> granicus.if.org Git - nethack/commitdiff
^X on MacOSX Qt
authorPatR <rankin@nethack.org>
Wed, 5 Aug 2020 18:26:25 +0000 (11:26 -0700)
committerPatR <rankin@nethack.org>
Wed, 5 Aug 2020 18:26:25 +0000 (11:26 -0700)
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
win/Qt/qt_main.cpp

index 1c6f4e479511d96881f5af07a12012a0bbd421e6..7dcf6459693e39c4fedf32a08b95fb06e3863087 100644 (file)
@@ -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
index 241c7a80196e74c779a73c1c786e7c34e3acfa01..4968fc7bf7a641074233c6ee9eac081bb9ed1321 100644 (file)
@@ -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 )