Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern void clearscr();

extern int press_any_key();
extern int press_any_key_ex(const char *msg, int sec);
extern int press_any_key_no_prompt(int sec);

extern void set_input_echo(int echo);

Expand Down
13 changes: 9 additions & 4 deletions src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,21 @@ inline int press_any_key()

int press_any_key_ex(const char *msg, int sec)
{
int ch = 0;
int duration = 0;
time_t t_begin = time(NULL);

moveto(SCREEN_ROWS, 0);
clrtoeol();

prints(msg);
iflush();

return press_any_key_no_prompt(sec);
}

inline int press_any_key_no_prompt(int sec)
{
int ch = 0;
int duration = 0;
time_t t_begin = time(NULL);

igetch_reset();

do
Expand Down
4 changes: 2 additions & 2 deletions utils/game/chicken.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ int pressany(int i)
moveto(23, 0);
prints(" %s ", cstate[i]);
iflush();
ch = igetch_t(MIN(BBS_max_user_idle_time, 60));
ch = press_any_key_no_prompt(60);
moveto(23, 0);
clrtoeol();
iflush();
Expand All @@ -688,7 +688,7 @@ int guess()
clrtoeol();
iflush();

ch = igetch_t(MIN(BBS_max_user_idle_time, 60));
ch = press_any_key_no_prompt(60);
if ((ch != '1') && (ch != '2') && (ch != '3'))
{
return -1; // error input
Expand Down