From 8edf4ba24decdd0df3f2b496bba57b3f4c1610ac Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Sun, 27 Jul 2008 14:59:06 +0000 Subject: [PATCH] Wait the release of a key if needed --- second/console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/second/console.c b/second/console.c index 5cebc85..ee318dc 100644 --- a/second/console.c +++ b/second/console.c @@ -67,6 +67,13 @@ int console_keypressed(int timeout) { long time = Ticks + timeout; + /* wait user releases the previous key */ + + while (serial_keypressed(SERIAL_MODEM_PORT) || + serial_keypressed(SERIAL_PRINTER_PORT) || + (vga_is_available() && keyboard_keypressed())) + ; + while (!timeout || (Ticks < time)) { if (serial_keypressed(SERIAL_MODEM_PORT))