Fixed escape and stop key definitions for the commodore machines
git-svn-id: svn://svn.cc65.org/cc65/trunk@1741 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Additional key defines */
|
/* Additional key defines */
|
||||||
|
#define CH_ESC 27
|
||||||
#define CH_F1 133
|
#define CH_F1 133
|
||||||
#define CH_F2 137
|
#define CH_F2 137
|
||||||
#define CH_F3 134
|
#define CH_F3 134
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ extern unsigned char _filetype; /* Default 'u' */
|
|||||||
#define CH_PI 126
|
#define CH_PI 126
|
||||||
#define CH_DEL 20
|
#define CH_DEL 20
|
||||||
#define CH_INS 148
|
#define CH_INS 148
|
||||||
#define CH_ESC 95
|
|
||||||
#define CH_ENTER '\n'
|
#define CH_ENTER '\n'
|
||||||
|
#define CH_STOP 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Additional key defines */
|
/* Additional key defines */
|
||||||
|
#define CH_ESC 27
|
||||||
#define CH_F1 133
|
#define CH_F1 133
|
||||||
#define CH_F2 137
|
#define CH_F2 137
|
||||||
#define CH_F3 134
|
#define CH_F3 134
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Additional key defines */
|
/* Additional key defines */
|
||||||
|
#define CH_ESC 27
|
||||||
#define CH_F1 224
|
#define CH_F1 224
|
||||||
#define CH_F2 225
|
#define CH_F2 225
|
||||||
#define CH_F3 226
|
#define CH_F3 226
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Additional key defines */
|
/* Additional key defines */
|
||||||
|
#define CH_ESC 27
|
||||||
#define CH_F1 224
|
#define CH_F1 224
|
||||||
#define CH_F2 225
|
#define CH_F2 225
|
||||||
#define CH_F3 226
|
#define CH_F3 226
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2001 Ullrich von Bassewitz */
|
/* (C) 1998-2002 Ullrich von Bassewitz */
|
||||||
/* Wacholderweg 14 */
|
/* Wacholderweg 14 */
|
||||||
/* D-70597 Stuttgart */
|
/* D-70597 Stuttgart */
|
||||||
/* EMail: uz@musoftware.de */
|
/* EMail: uz@musoftware.de */
|
||||||
@@ -45,6 +45,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Additional key defines */
|
||||||
|
#define CH_ESC 27
|
||||||
|
|
||||||
/* Color defines */
|
/* Color defines */
|
||||||
#define COLOR_BLACK 0x00
|
#define COLOR_BLACK 0x00
|
||||||
#define COLOR_WHITE 0x01
|
#define COLOR_WHITE 0x01
|
||||||
|
|||||||
@@ -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)
|
static char Input (char* Prompt, char* Buf, unsigned char Count)
|
||||||
/* Read input from the user, return 1 on success, 0 if aborted */
|
/* Read input from the user, return 1 on success, 0 if aborted */
|
||||||
{
|
{
|
||||||
@@ -503,7 +521,7 @@ static char Input (char* Prompt, char* Buf, unsigned char Count)
|
|||||||
} else if (c == '\n') {
|
} else if (c == '\n') {
|
||||||
Buf [i] = '\0';
|
Buf [i] = '\0';
|
||||||
done = 1;
|
done = 1;
|
||||||
} else if (c == CH_ESC) {
|
} else if (IsAbortKey (c)) {
|
||||||
/* Abort */
|
/* Abort */
|
||||||
done = 2;
|
done = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user