Diagnostic Programs
BASIC Code Listings
KEYBOARD TEST PROGRAM

9000 REM ==== KEYBOARD TEST PROGRAM ====
9100 REM ==== Display scan code and character ====
9110 PRINT "Keyboard test: press Ctrl/Break to terminate"
9120 K% = INP(96): IF K% = 0 OR K% > 127 THEN 9120
9130 K$ = INKEY$
9140 PRINT "Scan:"; RIGHT$("0" + HEX$(K%), 2);
9150 IF K% > 53 OR K$ = "" THEN PRINT " Numeric/Function/Cursor key": GOTO 9180
9160 IF ASC(K$) >= 32 THEN PRINT " Character: "; K$: GOTO 9180
9170 IF ASC(K$) > 1 THEN PRINT " ASCII code:"; ASC(K$): GOTO 9180
9180 K$ = INKEY$: L% = INP(96): IF L% = K% THEN 9180
9185 PRINT "Scan:"; RIGHT$("0" + HEX$(L%), 2)
9190 GOTO 9120