; *** Keytest ver 1.0 (C) 1997 by Dines Justesen *** ; ; This program will let you see all the scancodes ; returned by the keyboard handler. Press a key ; and the program will show you the scancode, except ; for ON which exits the program. Do note that the ; function does not return when 2nd or alpha is ; pressed (they are used to change cursor). The ; function also supports contrast change so 2nd and ; up/down changes the contrast but does not return. ; ; #INCLUDE "ti82.h" ; Std. include file #DEFINE L_TEXT_START SET 1,(IY+$0D) \ ROM_CALL(CLEAR_DISP) \ RES 1,(IY+$0D) \ RES 2,(IY+$0D) \ LD HL,$0000 \ LD (CURSOR_POS),HL ; Start up code L_TEXT_START SET 3,(IY+05) ; Display white on black LD HL,TitleStr ; Display title LD DE,(PROGRAM_ADDR) ADD HL,DE ROM_CALL(D_ZT_STR) ;3914h LD HL,$0007 ; Goto 7,0 LD (CURSOR_POS),HL LD HL,NameStr ; Display name LD DE,(PROGRAM_ADDR) ADD HL,DE ROM_CALL(D_ZT_STR) LD HL,$0003 ; Goto 3,0 LD (CURSOR_POS),HL RES 3,(IY+05) ; Display black on white LD HL,KeyStr ; Display char line LD DE,(PROGRAM_ADDR) ADD HL,DE ROM_CALL(D_ZT_STR) Main: LD HL,$0000 ; Goto position (0,0) LD (CURSOR_POS),HL ROM_CALL(KEY_HAND) ; Get key LD HL,$0803 ; Goto position (3,8) LD (CURSOR_POS),HL PUSH AF ; Save scan code for later LD H,0 ; Show number of key LD L,A ROM_CALL(D_HL_DECI) POP AF ; Restore scan code OR A ; Was key on ? JR NZ,Main ; No loop RES 4,(IY+9) ; Clear bit (enter has not been pressed) TEXT_END RET TitleStr: .DB "Keytest ver 1.0",0 KeyStr: .DB "Key : ",0 NameStr: .DB " Dines Justesen ",0 .END