From e3c982ee44cff38bd764fbb6ab94972cf868a10a Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 8 Dec 2019 12:27:00 +0100 Subject: Working text input! --- src/kernel/lib/stdio/getch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/kernel/lib/stdio') 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 -#include +#include 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 -- cgit v1.2.3