From f9fb6ec425c4067b9e9bd9ef67ae601b418ee932 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 8 Jun 2005 17:33:04 +0000 Subject: io.c: revised keyseq user/pmore: general update git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2810 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 29 +++++++++++++++++------------ mbbsd/pmore.c | 3 +++ mbbsd/user.c | 7 +++++++ 3 files changed, 27 insertions(+), 12 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/io.c b/mbbsd/io.c index 620bec77..3032fc3b 100644 --- a/mbbsd/io.c +++ b/mbbsd/io.c @@ -313,7 +313,7 @@ igetch(void) /* Escape sequence */ if (ch == '[' || ch == 'O') - mode = 2; + { mode = 2; last = ch; } else if (ch == '1' || ch == '4') /* what is this!? */ { mode = 3; last = ch; } else { @@ -352,6 +352,22 @@ igetch(void) else return KEY_UNKNOWN; } + else if (last == 'O') { + /* ^[O ... */ + if (ch >= 'A' && ch <= 'D') + return KEY_UP + (ch - 'A'); + if (ch >= 'P' && ch <= 'S') // vt100 k1-4 + return KEY_F1 + (ch - 'P'); + if (ch >= 'T' && ch <= '[') // putty vt100+ F5-F12 + return KEY_F5 + (ch - 'T'); + if (ch >= 't' && ch <= 'z') // vt100 F5-F11 + return KEY_F5 + (ch - 't'); + if (ch >= 'p' && ch <= 's') // Old (num or fn)kbd 4 keys + return KEY_F1 + (ch - 'p'); + else if (ch == 'a') // DELL spec + return KEY_F12; + } + else return KEY_UNKNOWN; } else if (mode == 3) { @@ -383,17 +399,6 @@ igetch(void) 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 #ifdef DEBUG diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index e3ec9c05..b742109c 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -2199,6 +2199,9 @@ pmore_wait_input(struct timeval *ptv) #endif do { + if(num_in_buf() > 0) // for EINTR + return 1; + sel = select(1, &readfds, NULL, NULL, ptv); } while (sel < 0 && errno == EINTR); /* EINTR, interrupted. I don't care! */ diff --git a/mbbsd/user.c b/mbbsd/user.c index 263fba09..fa97f55f 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -361,13 +361,20 @@ void Customize(void) #ifdef DBCSAWARE case 'i': +#if 0 + /* Actually, you can't try detection here. + * this function (customization)was not designed with the ability + * to refresh itself. + */ if(key == 'I') // one more try { if(u_detectDBCSAwareEvilClient()) cuser.uflag &= ~DBCSAWARE_FLAG; else cuser.uflag |= DBCSAWARE_FLAG; + } else +#endif cuser.uflag ^= DBCSAWARE_FLAG; break; #endif -- cgit v1.2.3