From 38fedfd78bdc81032495365e7cd76665d7b3b14f Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 7 Mar 2018 00:19:14 +0100 Subject: [PATCH] also show pressed key, so we can verify keyboard works with the joystick driver --- testcode/lib/joy-test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testcode/lib/joy-test.c b/testcode/lib/joy-test.c index 51cbb53e2..167534137 100644 --- a/testcode/lib/joy-test.c +++ b/testcode/lib/joy-test.c @@ -43,6 +43,7 @@ int main (void) unsigned char count; unsigned char i; unsigned char Res; + unsigned char ch, kb; clrscr (); @@ -90,6 +91,14 @@ int main (void) JOY_BTN_1(j)? "button" : " ---- ", j); #endif } + + /* show pressed key, so we can verify keyboard is working */ + kb = kbhit(); + ch = kb ? cgetc() : ' '; + gotoxy (1, i+2); + revers(kb); + cprintf("kbd: %c", ch); + revers(0); } return 0; } -- 2.39.5