From 49ab5387843086e5051f260870022eaeb1907a7a Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 8 Jun 2005 12:23:45 +0000 Subject: make new seq parser more robust git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2806 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/io.c b/mbbsd/io.c index 8f44087b..a57d005c 100644 --- a/mbbsd/io.c +++ b/mbbsd/io.c @@ -270,10 +270,13 @@ igetch(void) else if(ch == 'Z') { return KEY_STAB; - } else if (ch == '0') + } + else if (ch == '0') { if (dogetch() == 'Z') return KEY_STAB; + else + return KEY_UNKNOWN; } } else if (mode == 3) @@ -295,6 +298,7 @@ igetch(void) dogetch(); /* must be '~' */ return KEY_F6 + ch - '7'; } + else return KEY_UNKNOWN; } else if (last == '2') { if (ch >= '0' && ch <= '4') @@ -302,15 +306,19 @@ igetch(void) dogetch(); /* hope you are '~' */ return KEY_F9 + ch - '0'; } + else return KEY_UNKNOWN; } } else if(mode == 4) { /* ^[O ... */ + if (ch >= 'A' && ch <= 'D') + return KEY_UP + (ch - 'A'); if (ch >= 'p' && ch <= 'z') return KEY_F1 + (ch - 'p'); else if (ch == 'a') return KEY_F12; + else return KEY_UNKNOWN; } else // here is switch for default keys switch (ch) { // XXX: indent error -- cgit v1.2.3