summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/mbbsd/admin.c4
-rw-r--r--pttbbs/mbbsd/angel.c2
-rw-r--r--pttbbs/mbbsd/bbs.c2
-rw-r--r--pttbbs/mbbsd/bbslua.c6
-rw-r--r--pttbbs/mbbsd/card.c2
-rw-r--r--pttbbs/mbbsd/ch_dark.c2
-rw-r--r--pttbbs/mbbsd/chess.c8
-rw-r--r--pttbbs/mbbsd/chicken.c20
-rw-r--r--pttbbs/mbbsd/edit.c4
-rw-r--r--pttbbs/mbbsd/gamble.c2
-rw-r--r--pttbbs/mbbsd/io.c18
-rw-r--r--pttbbs/mbbsd/mail.c4
-rw-r--r--pttbbs/mbbsd/mbbsd.c2
-rw-r--r--pttbbs/mbbsd/menu.c2
-rw-r--r--pttbbs/mbbsd/read.c2
-rw-r--r--pttbbs/mbbsd/register.c2
-rw-r--r--pttbbs/mbbsd/stuff.c2
-rw-r--r--pttbbs/mbbsd/talk.c6
-rw-r--r--pttbbs/mbbsd/user.c4
-rw-r--r--pttbbs/mbbsd/vtuikit.c2
20 files changed, 48 insertions, 48 deletions
diff --git a/pttbbs/mbbsd/admin.c b/pttbbs/mbbsd/admin.c
index 011f81e7..8e434d4e 100644
--- a/pttbbs/mbbsd/admin.c
+++ b/pttbbs/mbbsd/admin.c
@@ -230,7 +230,7 @@ search_key_user(const char *passwdfile, int mode)
" A: add to namelist " ANSI_RESET " " :
" S: 取用備份資料 " ANSI_RESET " ");
while (1) {
- while ((ch = igetch()) == 0);
+ while ((ch = vkey()) == 0);
if (ch == 'a' || ch=='A' )
{
if(!friendfile[0])
@@ -293,7 +293,7 @@ search_user_bybakpwd(void)
do {
move(5, 1);
outs("選擇 => ");
- ch = igetch();
+ ch = vkey();
if (ch == 'q' || ch == 'Q')
return 0;
} while (ch < '1' || ch > '7');
diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c
index b2da644b..dee19527 100644
--- a/pttbbs/mbbsd/angel.c
+++ b/pttbbs/mbbsd/angel.c
@@ -484,7 +484,7 @@ pressanykey_or_callangel(){
ANSI_COLOR(37) "繼續 " ANSI_COLOR(1;34)
"▄▄▄▄▄▄▄▄▄▄▄▄▄▄ " ANSI_RESET);
do {
- ch = igetch();
+ ch = vkey();
if (ch == 'h' || ch == 'H'){
CallAngel();
break;
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 99f91acd..8a36e227 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -2626,7 +2626,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
prints(ANSI_RESET "[%d]? ",
RECTYPE_DEFAULT+1);
- type = igetch();
+ type = vkey();
if (!isascii(type) || !isdigit(type))
{
diff --git a/pttbbs/mbbsd/bbslua.c b/pttbbs/mbbsd/bbslua.c
index 76dbb529..1982e7ef 100644
--- a/pttbbs/mbbsd/bbslua.c
+++ b/pttbbs/mbbsd/bbslua.c
@@ -382,7 +382,7 @@ bl_print(lua_State* L)
BLAPI_PROTO
bl_getch(lua_State* L)
{
- int c = igetch();
+ int c = vkey();
if (c == BLCONF_BREAK_KEY)
{
drop_input();
@@ -545,7 +545,7 @@ bl_kball(lua_State *L)
#ifdef _WIN32
while (peekch(0))
{
- bl_k2s(L, igetch());
+ bl_k2s(L, vkey());
i++;
}
#else
@@ -560,7 +560,7 @@ bl_kball(lua_State *L)
(r = num_in_buf()) > 0 && oldr > r)
{
oldr = r;
- bl_k2s(L, igetch());
+ bl_k2s(L, vkey());
i++;
}
#endif
diff --git a/pttbbs/mbbsd/card.c b/pttbbs/mbbsd/card.c
index 48f29b98..21d9d9d2 100644
--- a/pttbbs/mbbsd/card.c
+++ b/pttbbs/mbbsd/card.c
@@ -131,7 +131,7 @@ card_select(int *now)
(*now == 2) ? cc[1] : cc[0],
(*now == 3) ? cc[1] : cc[0],
(*now == 4) ? cc[1] : cc[0]);
- switch (igetch()) {
+ switch (vkey()) {
case 'Q':
case 'q':
return 0;
diff --git a/pttbbs/mbbsd/ch_dark.c b/pttbbs/mbbsd/ch_dark.c
index 1571f2b0..2a85b51d 100644
--- a/pttbbs/mbbsd/ch_dark.c
+++ b/pttbbs/mbbsd/ch_dark.c
@@ -404,7 +404,7 @@ main_dark(int fd, userinfo_t * uin)
end = -1;
break;
}
- ch = igetch();
+ ch = vkey();
if (ch == I_OTHERDATA) {
ch = recv(fd, &dd.curr, sizeof(dd.curr), 0);
if (ch != sizeof(dd.curr)) {
diff --git a/pttbbs/mbbsd/chess.c b/pttbbs/mbbsd/chess.c
index cfd0906e..4ea194f0 100644
--- a/pttbbs/mbbsd/chess.c
+++ b/pttbbs/mbbsd/chess.c
@@ -445,7 +445,7 @@ ChessPlayFuncMy(ChessInfo* info)
info->actions->movecur(info->cursor.r, info->cursor.c);
oflush();
- ch = igetch();
+ ch = vkey();
if (ChessTimeCountDown(info, 0, now - last_time)) {
/* ran out of time */
game_result = CHESS_RESULT_LOST;
@@ -641,7 +641,7 @@ ChessPlayFuncHis(ChessInfo* info)
if (ChessTimeCountDown(info, 1, now - last_time)) {
info->lefttime[1] = 0;
- /* to make him break out igetch() */
+ /* to make him break out vkey() */
ChessMessageSend(info, CHESS_STEP_NOP);
}
last_time = now;
@@ -650,7 +650,7 @@ ChessPlayFuncHis(ChessInfo* info)
move(1, 0);
oflush();
- switch (ch = igetch()) {
+ switch (ch = vkey()) {
case 'q':
{
char buf[4];
@@ -770,7 +770,7 @@ ChessPlayFuncWatch(ChessInfo* info)
ChessDrawLine(info, CHESS_DRAWING_STEP_ROW);
move(1, 0);
- switch (igetch()) {
+ switch (vkey()) {
case I_OTHERDATA: /* new step */
result = ChessStepReceive(info, &info->step_tmp);
diff --git a/pttbbs/mbbsd/chicken.c b/pttbbs/mbbsd/chicken.c
index d8cc9afc..0e7eaf35 100644
--- a/pttbbs/mbbsd/chicken.c
+++ b/pttbbs/mbbsd/chicken.c
@@ -400,7 +400,7 @@ ch_guess(chicken_t *mychicken)
clrtobot();
outs("你要出[" ANSI_COLOR(32) "1" ANSI_RESET "]" ANSI_COLOR(33) "剪刀" ANSI_RESET "(" ANSI_COLOR(32) "2" ANSI_RESET ")"
ANSI_COLOR(33) "石頭" ANSI_RESET "(" ANSI_COLOR(32) "3" ANSI_RESET ")" ANSI_COLOR(33) "布" ANSI_RESET ":\n");
- me = igetch();
+ me = vkey();
me -= '1';
if (me > 2 || me < 0)
me = 0;
@@ -791,7 +791,7 @@ select_menu(int age GCC_UNUSED, chicken_t *mychicken)
chicken_food[(int)mychicken->type],
food_price[(int)mychicken->type]);
do {
- switch (ch = igetch()) {
+ switch (ch = vkey()) {
case '1':
ch_clean(mychicken);
check_sick(mychicken);
@@ -881,11 +881,11 @@ recover_chicken(chicken_t * thechicken)
outmsg(ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
" 別害怕 我是來幫你的 " ANSI_RESET);
bell();
- igetch();
+ vkey();
outmsg(ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
" 你無法丟到我水球 因為我是聖靈, 最近缺錢想賺外快 " ANSI_RESET);
bell();
- igetch();
+ vkey();
snprintf(buf, sizeof(buf), ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
" 你有一個剛走不久的%s要招換回來嗎? 只要 %d 元唷 " ANSI_RESET,
chicken_type[(int)thechicken->type], price);
@@ -907,7 +907,7 @@ recover_chicken(chicken_t * thechicken)
outmsg(ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
" 什麼 錢沒帶夠 沒錢的小鬼 快去籌錢吧 " ANSI_RESET);
bell();
- igetch();
+ vkey();
return 0;
}
revive_chicken(thechicken, 0);
@@ -918,14 +918,14 @@ recover_chicken(chicken_t * thechicken)
"今天心情好,拿你$%d就好 " ANSI_RESET, money);
outmsg(buf);
bell();
- igetch();
+ vkey();
return 1;
}
outmsg(ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45)
" 竟然說我坑人! 這年頭命真不值錢... " ANSI_RESET);
thechicken->lastvisit = 0;
bell();
- igetch();
+ vkey();
return 0;
}
@@ -1029,11 +1029,11 @@ chickenpk(int fd)
}
show_chicken_data(ochicken, mychicken);
- add_io(fd, 3); /* 把fd加到igetch監視 */
+ add_io(fd, 3); /* 把fd加到vkey監視 */
while (1) {
r = random();
- ch = igetch();
+ ch = vkey();
show_chicken_data(ochicken, mychicken);
time_diff(mychicken);
@@ -1132,7 +1132,7 @@ chickenpk(int fd)
break;
}
}
- add_io(0, 0); /* 把igetch恢復回 */
+ add_io(0, 0); /* 把vkey恢復回 */
pressanykey();
close(fd);
showdeadth(deadtype(mychicken, mychicken));
diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c
index 366c5673..f0af0beb 100644
--- a/pttbbs/mbbsd/edit.c
+++ b/pttbbs/mbbsd/edit.c
@@ -3428,7 +3428,7 @@ upload_file(void)
promptmsg = 0;
}
- c = igetch();
+ c = vkey();
if (c < 0x100 && isprint2(c))
{
insert_char(c);
@@ -3544,7 +3544,7 @@ vedit2(const char *fpath, int saveheader, int *islocal, char title[STRLEN], int
ch = curr_buf->currpnt - curr_buf->edit_margin;
move(curr_buf->curr_window_line, ch);
- ch = igetch();
+ ch = vkey();
/* jochang debug */
if ((interval = (now - th))) {
th = now;
diff --git a/pttbbs/mbbsd/gamble.c b/pttbbs/mbbsd/gamble.c
index c43d4030..445cfe20 100644
--- a/pttbbs/mbbsd/gamble.c
+++ b/pttbbs/mbbsd/gamble.c
@@ -197,7 +197,7 @@ ticket(int bid)
reload_money();
prints(ANSI_COLOR(44) "錢: %-10d " ANSI_RESET "\n" ANSI_COLOR(1) "請選擇要購買的種類(1~%d)"
"[Q:離開]" ANSI_RESET ":", cuser.money, count);
- ch = igetch();
+ ch = vkey();
/*--
Tim011127
為了控制CS問題 但是這邊還不能完全解決這問題,
diff --git a/pttbbs/mbbsd/io.c b/pttbbs/mbbsd/io.c
index e0b017ba..8b391611 100644
--- a/pttbbs/mbbsd/io.c
+++ b/pttbbs/mbbsd/io.c
@@ -563,18 +563,10 @@ process_pager_keys(int ch)
return ch;
}
-#ifndef vkey
-int
-vkey(void)
-{
- return igetch();
-}
-#endif
-
// virtual terminal keyboard context
static VtkbdCtx vtkbd_ctx;
-int
+inline int
igetch(void)
{
register int ch;
@@ -630,6 +622,14 @@ igetch(void)
return ch;
}
+#ifndef vkey
+inline int
+vkey(void)
+{
+ return igetch();
+}
+#endif
+
/*
* wait user input anything for f seconds.
* if f < 0, then wait forever.
diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c
index 4ab5bdcc..39049777 100644
--- a/pttbbs/mbbsd/mail.c
+++ b/pttbbs/mbbsd/mail.c
@@ -484,7 +484,7 @@ do_send(const char *userid, const char *title)
clear();
prints("信件即將寄給 %s\n標題為:%s\n確定要寄出嗎? (Y/N) [Y]",
userid, save_title);
- switch (igetch()) {
+ switch (vkey()) {
case 'N':
case 'n':
outs("N\n信件已取消");
@@ -980,7 +980,7 @@ read_new_mail(void * voidfptr, void *optarg)
vs_footer(" 信件處理 ",
" (R)回信 (x)站內轉寄 (y)回群組信 (d/D)刪信");
- switch (igetch()) {
+ switch (vkey()) {
case 'r':
case 'R':
mail_reply(arg->idc, fptr, currmaildir);
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index 11091193..3a683fc5 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/mbbsd/mbbsd.c
@@ -570,7 +570,7 @@ write_request(int sig)
memmove(&currutmp->msgs[0],
&currutmp->msgs[1],
sizeof(msgque_t) * currutmp->msgcount);
- igetch();
+ vkey();
}
}
diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c
index 49762d38..352dcdba 100644
--- a/pttbbs/mbbsd/menu.c
+++ b/pttbbs/mbbsd/menu.c
@@ -539,7 +539,7 @@ domenu(int menu_index, const char *cmdtitle, int cmd, const commands_t cmdtable[
pos++;
cursor_show(menu_row + pos, menu_column);
- } while (((cmd = igetch()) != EOF) || refscreen);
+ } while (((cmd = vkey()) != EOF) || refscreen);
abort_bbs(0);
}
diff --git a/pttbbs/mbbsd/read.c b/pttbbs/mbbsd/read.c
index ba9aa67e..fef236b3 100644
--- a/pttbbs/mbbsd/read.c
+++ b/pttbbs/mbbsd/read.c
@@ -665,7 +665,7 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem,
return mode;
if( !default_ch )
- ch = igetch();
+ ch = vkey();
else{
if(new_ln != locmem->crs_ln) {// move fault
default_ch=0;
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index bee85fec..4897cc63 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -2183,7 +2183,7 @@ ui_display_regform_single(
outs("是否接受此資料(Y/N/Q/Del/Skip)?[S] ");
// round to ASCII
- while ((c = igetch()) > 0xFF);
+ while ((c = vkey()) > 0xFF);
c = tolower(c);
if (c == 'y' || c == 'q' || c == 'd' || c == 's')
diff --git a/pttbbs/mbbsd/stuff.c b/pttbbs/mbbsd/stuff.c
index a4d0ddb1..a1febfa8 100644
--- a/pttbbs/mbbsd/stuff.c
+++ b/pttbbs/mbbsd/stuff.c
@@ -277,7 +277,7 @@ cursor_key(int row, int column)
int ch;
cursor_show(row, column);
- ch = igetch();
+ ch = vkey();
move(row, column);
outs(STR_UNCUR);
return ch;
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c
index 49f20e82..708c56ea 100644
--- a/pttbbs/mbbsd/talk.c
+++ b/pttbbs/mbbsd/talk.c
@@ -641,7 +641,7 @@ my_write2(void)
which = 0;
do {
- switch ((ch = igetch())) {
+ switch ((ch = vkey())) {
case Ctrl('T'):
case KEY_UP:
if (water_usies != 1) {
@@ -1170,7 +1170,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){
add_io(sock, timeout);
while (1) {
- ch = igetch();
+ ch = vkey();
if (ch == I_TIMEOUT) {
ch = uin->mode;
if (!ch && uin->chatid[0] == 1 &&
@@ -1394,7 +1394,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
ChessEstablishRequest(msgsock);
add_io(msgsock, 0);
- while ((ch = igetch()) != I_OTHERDATA) {
+ while ((ch = vkey()) != I_OTHERDATA) {
if (ch == Ctrl('D')) {
add_io(0, 0);
close(msgsock);
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index 6623c316..4188c81d 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -1475,7 +1475,7 @@ u_list_CB(void *data, int num, userec_t * uentp)
prints(ANSI_COLOR(34;46) " 已顯示 %d/%d 人(%d%%) " ANSI_COLOR(31;47) " "
"(Space)" ANSI_COLOR(30) " 看下一頁 " ANSI_COLOR(31) "(Q)" ANSI_COLOR(30) " 離開 " ANSI_RESET,
ctx->usercounter, ctx->totalusers, ctx->usercounter * 100 / ctx->totalusers);
- ch = igetch();
+ ch = vkey();
if (ch == 'q' || ch == 'Q')
return -1;
ctx->y = 3;
@@ -1539,7 +1539,7 @@ u_list(void)
clrtoeol();
prints(ANSI_COLOR(34;46) " 已顯示 %d/%d 的使用者(系統容量無上限) "
ANSI_COLOR(31;47) " (請按任意鍵繼續) " ANSI_RESET, ctx->usercounter, ctx->totalusers);
- igetch();
+ vkey();
return 0;
}
diff --git a/pttbbs/mbbsd/vtuikit.c b/pttbbs/mbbsd/vtuikit.c
index 6847d82e..1e84502c 100644
--- a/pttbbs/mbbsd/vtuikit.c
+++ b/pttbbs/mbbsd/vtuikit.c
@@ -441,7 +441,7 @@ vmsg(const char *msg)
// wait for key
do {
- i = igetch();
+ i = vkey();
} while( i == 0 );
// clear message bar