From 356f4957facc85f93788cacdbde1e76ff65e3a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 15 Nov 2004 18:02:50 +0000 Subject: [PATCH] Added a function that clears the keyboard buffer. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9958 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/bios_ia32/keyboard.cpp | 8 ++++++++ src/kernel/boot/platform/bios_ia32/keyboard.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/kernel/boot/platform/bios_ia32/keyboard.cpp b/src/kernel/boot/platform/bios_ia32/keyboard.cpp index 095b2f929c..ed0838cc57 100644 --- a/src/kernel/boot/platform/bios_ia32/keyboard.cpp +++ b/src/kernel/boot/platform/bios_ia32/keyboard.cpp @@ -33,6 +33,14 @@ check_for_key(void) } +extern "C" void +clear_key_buffer(void) +{ + while (check_for_key() != 0) + ; +} + + extern "C" union key wait_for_key(void) { diff --git a/src/kernel/boot/platform/bios_ia32/keyboard.h b/src/kernel/boot/platform/bios_ia32/keyboard.h index 7978bdcd89..54ceeadcdf 100644 --- a/src/kernel/boot/platform/bios_ia32/keyboard.h +++ b/src/kernel/boot/platform/bios_ia32/keyboard.h @@ -26,6 +26,7 @@ union key { extern "C" { #endif +extern void clear_key_buffer(void); extern union key wait_for_key(void); extern uint32 check_for_boot_keys(void);