From 2f457e6c60de28d68d2da2487838fadff5f38997 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Wed, 23 Nov 2005 01:16:55 +0000 Subject: [PATCH] Move idle() to front of waitforkey() so we don't have to wait for the clock; also, comments. --- demos/tui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/tui.c b/demos/tui.c index efa2227f..8c843f1c 100644 --- a/demos/tui.c +++ b/demos/tui.c @@ -47,7 +47,7 @@ void rmerror (void); #endif #ifdef PDCDEBUG -char *rcsid_tui = "$Id: tui.c,v 1.6 2005/11/23 00:47:07 wmcbrine Exp $"; +char *rcsid_tui = "$Id: tui.c,v 1.7 2005/11/23 01:16:55 wmcbrine Exp $"; #endif #if defined(__unix) && !defined(__DJGPP__) @@ -584,7 +584,7 @@ int waitforkey (void) int waitforkey () #endif { - while (!keypressed()) idle (); + do idle (); while (!keypressed()); return getkey (); } @@ -702,8 +702,8 @@ char *mtitle; cbreak (); /* direct input (no newline required)... */ noecho (); /* ... without echoing */ hidecursor (); /* hide cursor (if possible) */ - nodelay (wbody, TRUE); /* don't wait for input */ - halfdelay(10); + nodelay (wbody, TRUE); /* don't wait for input... */ + halfdelay(10); /* ...well, no more than a second, anyway */ keypad (wbody, TRUE); /* enable cursor keys */ scrollok (wbody, TRUE); /* enable scrolling in main window */ leaveok (stdscr, TRUE);