diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-09 01:33:04 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-09 01:33:04 +0800 |
commit | f9fb6ec425c4067b9e9bd9ef67ae601b418ee932 (patch) | |
tree | 36ffc794234379963e8e0d4fd3c9fd1e0a5053cb | |
parent | 1b48c6b5e274d2744286e70300a36e758763aa7e (diff) | |
download | pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar.gz pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar.bz2 pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar.lz pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar.xz pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.tar.zst pttbbs-f9fb6ec425c4067b9e9bd9ef67ae601b418ee932.zip |
io.c: revised keyseq
user/pmore: general update
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2810 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/io.c | 29 | ||||
-rw-r--r-- | mbbsd/pmore.c | 3 | ||||
-rw-r--r-- | mbbsd/user.c | 7 |
3 files changed, 27 insertions, 12 deletions
@@ -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 |