diff options
Diffstat (limited to 'src/kernel/lib/stdio')
-rw-r--r-- | src/kernel/lib/stdio/getch.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kernel/lib/stdio/getch.c b/src/kernel/lib/stdio/getch.c index 5361c97..f3ccbd9 100644 --- a/src/kernel/lib/stdio/getch.c +++ b/src/kernel/lib/stdio/getch.c @@ -1,9 +1,11 @@ #include <kernel/input/input.h> -#include <kernel/lib/string.h> +#include <kernel/timer/timer.h> char getch() { - keyboard_clear_buffer(); - while (strlen(keyboard_buffer) == 0) {} - return keyboard_buffer[0]; + keyboard_char_buffer = 0; + while (keyboard_char_buffer == 0) { + timer_wait(1); // IDK why! + } + return keyboard_char_buffer; }
\ No newline at end of file |