]> git.sur5r.net Git - cc65/commitdiff
Fixed escape and stop key definitions for the commodore machines
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Dec 2002 21:01:34 +0000 (21:01 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Dec 2002 21:01:34 +0000 (21:01 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1741 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/c128.h
include/cbm.h
include/cbm264.h
include/cbm510.h
include/cbm610.h
include/pet.h
libsrc/dbg/dbg.c

index 85782aef377c307797f82ce521c92ce10b71426d..ebb367e3b739ccadd1af9570928df1837f155330 100644 (file)
@@ -46,6 +46,7 @@
 
 
 /* Additional key defines */
+#define CH_ESC                  27
 #define CH_F1                  133
 #define CH_F2                  137
 #define CH_F3                  134
index ba831dd54a6e9b29f151ddf289218ffdfdb46b17..12753deb1113f91e131cec1bba5e5f653c65f69c 100644 (file)
@@ -104,8 +104,8 @@ extern unsigned char _filetype;         /* Default 'u' */
 #define CH_PI                  126
 #define CH_DEL                  20
 #define CH_INS                 148
-#define CH_ESC                  95
 #define CH_ENTER                '\n'
+#define CH_STOP                   3
 
 
 
index 25d8e84da35a26c2d1c9568ad38c1b6b4c46d8a6..a9125d5d536e276154658b641fb7813d8cae9266 100644 (file)
@@ -46,6 +46,7 @@
 
 
 /* Additional key defines */
+#define CH_ESC                  27
 #define CH_F1                          133
 #define CH_F2                          137
 #define CH_F3                          134
 
 
 
-                
+
index 9f03f121724a5934e2ac7a1861a8b65353e97f55..078557f947b682c953c1adff4abbdbd3f64566c5 100644 (file)
@@ -46,6 +46,7 @@
 
 
 /* Additional key defines */
+#define CH_ESC                  27
 #define CH_F1                  224
 #define CH_F2                  225
 #define CH_F3                  226
index 723d876993a4e7826eea7f537c5e3e3e4ee3ae02..8f9e78c6abf8810cba2384a4c1fb3e1741f4ca98 100644 (file)
@@ -46,6 +46,7 @@
 
 
 /* Additional key defines */
+#define CH_ESC                  27
 #define CH_F1                  224
 #define CH_F2                  225
 #define CH_F3                  226
index 684d20f814a30858dc79adc39d2d921706146e53..ccc31432f05a75a3daf6a14167924f1844590a5a 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2001 Ullrich von Bassewitz                                       */
+/* (C) 1998-2002 Ullrich von Bassewitz                                       */
 /*               Wacholderweg 14                                             */
 /*               D-70597 Stuttgart                                           */
 /* EMail:        uz@musoftware.de                                            */
@@ -45,6 +45,9 @@
 
 
 
+/* Additional key defines */
+#define CH_ESC                  27
+
 /* Color defines */
 #define COLOR_BLACK            0x00
 #define COLOR_WHITE            0x01
index c285027d4894c015e8d86a9d34ff130890b2d6ed..a929bddcf147fd88aa46e3a2bc48a81efea8edcf 100644 (file)
@@ -465,6 +465,24 @@ static void AnyKeyPrompt (void)
 
 
 
+static char IsAbortKey (char C)
+/* Return true if C is an abort key */
+{
+#if defined(CH_ESC)
+    if (C == CH_ESC) {
+        return 1;
+    }
+#endif
+#if defined(CH_STOP) 
+    if (C == CH_STOP) {
+        return 1;
+    }
+#endif
+    return 0;
+}
+
+
+
 static char Input (char* Prompt, char* Buf, unsigned char Count)
 /* Read input from the user, return 1 on success, 0 if aborted */
 {
@@ -503,8 +521,8 @@ static char Input (char* Prompt, char* Buf, unsigned char Count)
        } else if (c == '\n') {
            Buf [i] = '\0';
            done = 1;
-       } else if (c == CH_ESC) {
-           /* Abort */
+       } else if (IsAbortKey (c)) {
+           /* Abort */          
            done = 2;
        }
     } while (!done);
@@ -1500,4 +1518,4 @@ void DbgEntry (void)
 }
 
 
-    
+