From c3c3ebb1196dd11d4d9e4149681aeb868784e286 Mon Sep 17 00:00:00 2001
From: "nethack.allison" <nethack.allison>
Date: Mon, 11 Mar 2002 22:33:21 +0000
Subject: [PATCH] (from Yitzhak) patch: rollback alt-key changes

---
 sys/winnt/porthelp | 19 +++++++++----------
 win/win32/mhmain.c | 10 +++-------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/sys/winnt/porthelp b/sys/winnt/porthelp
index 60e7ce862..c870cfd44 100644
--- a/sys/winnt/porthelp
+++ b/sys/winnt/porthelp
@@ -27,19 +27,19 @@ Some options are applicable only to the graphical port.
 These are discussed separately in their own section. 
 
 Contents
-1. Available ALT Key Combinations
+1. Available NetHack Mode ALT Key Combinations
 2. Boolean options
 3. Graphical Port Complex options
 4. Graphical Port Additional/Enhanced Commands
 5. Graphical Port Menus
 
-1. Available ALT Key Combinations
----------------------------------
-While playing NetHack under Windows you can press the ALT key in 
-combination with another key to execute an extended command as an 
-alternative method to pressing a # key sequence. (The non-graphical
+1. Available NetHack Mode ALT Key Combinations
+----------------------------------------------
+While playing NetHack under Windows in NetHack mode you can press the
+ALT key in combination with another key to execute an extended command
+as an alternative method to pressing a # key sequence.  The non-graphical
 (tty) version is always running in NetHack mode, but 
-"NetHack for Windows - Graphical Interface" can be toggled): 
+"NetHack for Windows - Graphical Interface" can be toggled:
 
     Alt-2    #twoweapon      - toggle two-weapon combat (unavailable
                                if number_pad mode is set)
@@ -47,18 +47,17 @@ alternative method to pressing a # key sequence. (The non-graphical
     Alt-c    #chat           - talk to someone or something.
     Alt-d    #dip            - dip an object into something.
     Alt-e    #enhance        - enhance your skill with a weapon.
-    Alt-f    #force          - force a lock. [works in NetHack mode only]
+    Alt-f    #force          - force a lock.
     Alt-i    #invoke         - invoke an object's powers.
     Alt-j    #jump           - jump to a location.
     Alt-l    #loot           - loot a box on the floor.
     Alt-m    #monster        - use a monster's special ability. 
-                               [works in NetHack mode only]
     Alt-n    #name           - name an item or type of object.
     Alt-o    #offer          - offer a sacrifice to the gods.
     Alt-p    #pray           - pray to the gods for help.
     Alt-q    #quit           - quit the game. (Same as #quit)
     Alt-r    #rub            - rub a lamp.
-    Alt-s    #sit            - sit down. [works in NetHack mode only]
+    Alt-s    #sit            - sit down.
     Alt-t    #turn           - turn undead.
     Alt-u    #untrap         - untrap something.
     Alt-v    #version        - list compile time options for this version of
diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c
index 950d500ff..5f5d2042d 100644
--- a/win/win32/mhmain.c
+++ b/win/win32/mhmain.c
@@ -133,8 +133,7 @@ numpad[KEY_LAST][3] = {
   
 #define IS_MAP_ASCII(mode) ((mode)!=MAP_MODE_TILES && (mode)!=MAP_MODE_TILES_FIT_TO_SCREEN)
 
-static const char *extendedlist_nhmode = "acdefijlmnopqrstuvw?2";
-static const char *extendedlist_winmode = "acdeijlnopqrtuvw?2";
+static const char *extendedlist = "acdefijlmnopqrstuvw?2";
 
 #define SCANLO		0x02
 static const char scanmap[] = { 	/* ... */
@@ -378,14 +377,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
               If not nethackmode, don't handle Alt-keys here.
               If no Alt-key pressed it can never be an extended command 
             */
-	    if ((lParam & 1<<29) != 0)
+	    if (GetNHApp()->regNetHackMode && ((lParam & 1<<29) != 0))
             {
                 unsigned char c = (unsigned char)(wParam & 0xFF);
 		unsigned char scancode = (lParam >> 16) & 0xFF;
-                if (index(
-		    GetNHApp()->regNetHackMode
-			? extendedlist_nhmode :  extendedlist_winmode,
-		    tolower(c)) != 0)
+                if (index(extendedlist, tolower(c)) != 0)
 		{
 		    NHEVENT_KBD(M(tolower(c)));
 		} else if (scancode == (SCANLO + SIZE(scanmap)) - 1) {
-- 
2.40.0