KeyScan

Date: 198x
Type: Program
Platform(s): TS 2068

Displays information about the currently pressed key.

Appears on

One of a series of library tapes. Programs on these tapes were renamed to a number series. This tape contained programs 20001 to 20050. These tapes were compiled by Tony Willing.

Gallery

KeyScan

Source Code

   10 REM Keyboard scanning
   11 REM function
   12 REM 
   20 REM lower RAMTOP
   21 REM 
   30 RESTORE : LET x=(PEEK 23730+256*PEEK 23731)-26: CLEAR x
   40 REM 
   41 REM POKE Machine code
   42 REM into memory
   43 REM 
   50 LET x=(PEEK 23730+256*PEEK 23731)+1
   60 FOR y=x TO x+24: READ z: POKE y,z: NEXT y
   70 REM 
   71 REM Print USR address
   72 REM 
   80 PRINT AT 1,2;"The routine is called by the";TAB 7;"function USR ";x
   90 REM 
   91 REM Example
   92 REM 
  100 PRINT AT 8,10;"Press any keys"
  110 PRINT AT 12,14;: LET a=USR x
  120 IF a=0 THEN PRINT "NONE "
  130 IF a=1 THEN PRINT "LEFT "
  140 IF a=2 THEN PRINT "RIGHT"
  150 IF a=3 THEN PRINT "BOTH "
  160 PRINT AT 16,10;"USR ";x;" = ";a
  170 GO TO 110
  180 REM 
  181 REM Machine code data
  182 REM 
  190 DATA 1,0,0,62,240,219,254,47
  200 DATA 230,31,40,2,203,193,62,15
  210 DATA 219,254,47,230,31,200,203,201,201

People

No people associated with this content.

Scroll to Top