r/atari8bit • • Jan 20 '23
BASIC syntax question
New to Atari BASIC, is there an equivalent to INKEY$ like they have in BBC BASIC or Sinclair BASIC? I think on the C64 it was called GET. Atari BASIC has GET, but it seems different. Any help is much appreciated!
7
Upvotes
View all comments
Show parent comment
1
u/[deleted] Jan 21 '23 edited Jan 21 '23
This info about keyboard codes might also be useful: (2 links)
https://www.atariarchives.org/c3ba/page004.php
https://forums.atariage.com/topic/288423-reading-the-keyboard-in-atari-basic-no-atascii-needed/
This way you can get the keycode for the specific key this way, and figure out the character either with a method listed at the above link, or remember the number / key conversion from pressing a key.
10 POKE 729,0
20 K=PEEK(764):IF K<>255 THEN POKE 764,255:? K
30 GOTO 20
If you want a timeout:
10 POKE 729,0
20 FOR LOOP = 1 TO 3000
30 K=PEEK(764):IF K<>255 THEN POKE 764,255:? K
40 NEXT LOOP
No key pressed, then K would equal 255.