[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Programming Question
In article <1d8_9711291213@ima.infomail.com>,
Robert Fletcher <Robert.Fletcher@311.ima.infomail.com> wrote:
>Enough about me, now my question. How can I, in Applesoft Basic, get
>input from the keyboard with out stopping the program? If Basic can
>not do this, then just let me know. I will be working on assembly,
>after I have master the art of structure design.
Drop by the Applesoft Basic reference/FAQ I wrote at
http://www.visi.com/~nathan/a2/faq/asoft.html section 3.3 "Text Input
from the keyboard". I quote:
--- snip
The final, and most on the metal method, is to read the 1-character
input buffer yourself. If the return value from 'PEEK (49152)' ('PEEK
(-16384)') is identical, but uses one more character) is less than
128, nothing has been hit. If it is greater than 128, the key hit has
ascii value of the return value minus 128. Thus, 'A$=CHR$(PEEK
(49152)-128)' will set A$ to the key that was hit. 'POKE 49168,0'
('POKE -16368,0' is also identical) will tell the system that you've
dealt with the keypress; if this is not done, it'll continually report
that one key down.
--- snip
Nathan Mates
--
<*> Nathan Mates http://www.visi.com/~nathan/ <*>
# This posting is copyright Nathan Mates, and may not be reprinted
# in full, partial, or quoted form on any archive site associated with
# Charles Turley.