diff options
author | Marvin Borner | 2019-12-08 12:27:00 +0100 |
---|---|---|
committer | Marvin Borner | 2019-12-08 12:27:00 +0100 |
commit | e3c982ee44cff38bd764fbb6ab94972cf868a10a (patch) | |
tree | 755ed2716a4a3fb6caf04abaef00a784297692fe /src/kernel/lib/stdio | |
parent | d94b024b73aeca06de417e0fd3c502495312a8b2 (diff) |
Working text input!
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 |