home *** CD-ROM | disk | FTP | other *** search
- 100 ' KEYCODE.BAS
- 110 '
- 120 ' ╔═══════════════════════════════════════════════════════════════════════╗
- 130 ' ║ REFERENCE: ║
- 140 ' ║ PC Magazine DOS Power Tools (techniques, tricks, and utilities), ║
- 150 ' ║ Paul Somerson, Bantam Computer Books, June 1988, page 466 ║
- 160 ' ║ ║
- 170 ' ║ The program will also display the character and code for the extended ║
- 180 ' ║ IBM character set, i.e, those with values from 128 thru 255. Display ║
- 190 ' ║ of these characters and codes require pressing the ALT key and then ║
- 200 ' ║ using the numeric key pad to enter the value from 128 thru 255. The ║
- 210 ' ║ character and code is then displayed upon release of the ALT key. ║
- 220 ' ║ ║
- 230 ' ║ This version is a refinement of the program presented in the book. ║
- 240 ' ║ The key codes of all the keys are displayed. Mnemonics are displayed ║
- 250 ' ║ for those special keys that BASIC interprets as screen commands. ║
- 260 ' ║ ║
- 270 ' ║ Written by: Dennis W. Person Date: August 29, 1991 ║
- 280 ' ║ 6828 Devonshire Drive ║
- 290 ' ║ Canton, Michigan 48187-2613 ║
- 300 ' ╚═══════════════════════════════════════════════════════════════════════╝
- 310 '
- 320 KEY OFF :REM turn off function keys
- 330 FOR A%=1 TO 10:KEY A%,"":NEXT A% :REM clear key assignments
- 340 '
- 350 COLOR 14,0,0:CLS :REM set text color to yellow w/ black background & border
- 360 LOCATE ,,1,0,7 :REM turn cursor on and set block cursor
- 370 '
- 390 PRINT "Press any key to display code(s) or ESC to end ? ";
- 400 I$=INKEY$:IF I$="" GOTO 400 :REM loop until key is pressed
- 410 '
- 420 IF I$=CHR$(7) THEN PRINT "BEL"; :GOTO 570 :' CTRL-G
- 430 IF I$=CHR$(9) THEN PRINT "TAB"; :GOTO 570 :' CTRL-I
- 440 IF I$=CHR$(10) THEN PRINT "LF "; :GOTO 570 :' CTRL-J
- 450 IF I$=CHR$(11) THEN PRINT "VT "; :GOTO 570 :' CTRL-K
- 460 IF I$=CHR$(12) THEN PRINT "FF "; :GOTO 570 :' CTRL-L
- 470 IF I$=CHR$(13) THEN PRINT "CR "; :GOTO 570 :' CTRL-M
- 480 IF I$=CHR$(27) THEN PRINT "ESC"; :GOTO 570 :' CTRL-[
- 490 IF I$=CHR$(28) THEN PRINT "^\ "; :GOTO 570 :' CTRL-\
- 500 IF I$=CHR$(29) THEN PRINT "^] "; :GOTO 570 :' CTRL-]
- 510 IF I$=CHR$(30) THEN PRINT "^^ "; :GOTO 570 :' CTRL-^
- 520 IF I$=CHR$(31) THEN PRINT "^_ "; :GOTO 570 :' CTRL-_
- 530 IF I$=CHR$(32) THEN PRINT "SPC"; :GOTO 570 :' Space character
- 540 IF I$=CHR$(127) THEN PRINT "DEL"; :GOTO 570 :' CTRL-BACKSPACE
- 550 '
- 560 IF LEN(I$)=1 THEN PRINT I$; ELSE PRINT "ext. 0 +";
- 570 PRINT ASC(RIGHT$(I$,1))
- 580 IF I$<>CHR$(27) GOTO 390
- 590 '
- 600 PRINT:COLOR 7,0,0 :REM restore default screen colors of white text
- 610 ' with black background and black border
- 620 LOCATE ,,,7,7 :REM restore default underline cursor
- 630 SYSTEM
-