Download Print this page

Atari CX70 Operator's Manual page 41

Light pen

Advertisement

ATARI Light Pen Operator's Manual
SECTION 7 - PROGRAMMING EXAMPLE 3: A Keyboard Substitute
This program illustrates a uay to substitute the light pen for the
keyboard. It produces the complete alphabet and selected punctuation
characters across the top of the screen. When you type in and RUN the
program^ pointing to any letter with the pen will cause that letter to
be typed on the screen at the current cursor location. The last two
charactersi b and r» are added at the end of the character seq.uence
and stand for backspace and carriage return. See Figure 14 for the
program listing.
1 REM DEMO #3, A KEYBOARD SUBSTITUTE
10 DIM A$<40):POKE 82»0
20 GRAPHICS 0:SETCOLOR 2,0,81SETCOLOR 1,0,14
30 PENBUF=1536JP0KE 205,15JGOSUB 9000
40 A«="ABCDEFGHIJKLMNOPQRSTUVWXYZ ♦,11!?()*#'br"
50 FOR Q=1 TO LEN<A*> JPRINT AiKQ,Q)r'
"IINEXT 0
60 IF PEEK(632)«15 THEN 60
70 JUNK=USR<PENBUF)
80 PC=PEEK<208)1PR=PEEK(209)
90 IF PR>2 THEN 60
95 SUBSC=(40)KPR+PC)/3+l
10 0 SUBSC=:INT(SUBSC+0*5)
110 IF SUBSC<39 THEN PRINT A^(SUBSC,SUBSC)1IGOTO 300
200 IF SUBSC=39 THEN PRINT CHR$<126)1JGOTO 3001REM BACKSPACE CHARACTER
210 PRINT
300 IF PEEK(632)=14 THEN 300
310 GOTO 60
9000 REM "LOADER" LOADS "PENBUF" INTO PAGE 6
9010 RESTORE 9020JFOR X=1536 TO 1652:READ PIPOKE X,P:NEXT XIRETURN
9020 DATA 104,162,0,160,6,132,204,173,12,212,201,10,144,3,56,233,228
9030 DATA 24,105,154,160,117,132,203,32,86,6,165,203,24,101,205,133
9040 DATA 203,173,13,212,56,233,16,32,86,6,232,228,205,240,9,165
9050 DATA 20,197,20,240,252,76,7,6,165,205,74,168,177,203,133,207
9060 DATA 169,117,133,203,177,203,133,206,165,206,74,74,133,208,165,207
9070 DATA 74,74,133,209,96,134,206,164,206,192,0,240,20,136,209,203
9080 DATA 200,176,14,136,133,206,177,203,200,145,203,136,165,206,56,176
9090 DATA 232,145,203,96
Figure 14
Programming Example 3; A Keyboard Substitute
A Keyboard Sustitute - 37

Advertisement

loading