Flushing input prior to getch()
modified: src/nms.c
This commit is contained in:
parent
0f5db67cac
commit
1782f6d248
@ -131,6 +131,9 @@ char nmsexec(char *src) {
|
||||
usleep(TYPE_EFFECT_SPEED * 1000);
|
||||
}
|
||||
|
||||
// Flush any input up to this point
|
||||
flushinp();
|
||||
|
||||
// Reopen stdin for interactive input (keyboard), then require user
|
||||
// to press a key to continue.
|
||||
if (!isatty(STDIN_FILENO))
|
||||
@ -215,6 +218,9 @@ char nmsexec(char *src) {
|
||||
attroff(COLOR_PAIR(1));
|
||||
}
|
||||
|
||||
// Flush any input up to this point
|
||||
flushinp();
|
||||
|
||||
// If stdin is set to the keyboard, user must press a key to continue
|
||||
if (isatty(STDIN_FILENO))
|
||||
ret = getch();
|
||||
|
Loading…
Reference in New Issue
Block a user