Re: A86: multiple keys


[Prev][Next][Index][Thread]

Re: A86: multiple keys




At 07:53 PM 4/4/99 EDT, you wrote:
>In a message dated 4/4/99 4:52:00 PM Pacific Daylight Time, v8r@juno.com 
>writes:
>
><< 
> The trick is to read port 1....
> 
> You can find this information under the Assembly Studio 86 Online help
> under ports... It is also covered in Dux's tutorial
>  >>
>those show how to check for one key which i understand but not how to check 
>for two keys at once 

About 2 years ago I wrote a routine called MULTI_KEY for the 82 (should not
need any editing to get it to work on the 86).  If you know how to use
TI-Basic's GetKey statement, then you already know how to use MULTI_KEY.
Basically, you #include "multikey.h" at the start of your program and
#include "multikey.inc" at the end.  Then, doing something like:

...
Loop:
  MULTI_KEY(KEY_21)
  CALL_Z(2ndPressed)
  MULTI_KEY(KEY_22)  ; See if user is wanting to quit
  CALL_Z(Exit)
  MULTI_KEY(KEY_26)  ; Right arrow on 82 (same for 86?)
  CALL_Z(RightPressed)
  jr Loop
...

That's it.  All the port stuff is handled for you.  Thus, your code is
cleaner and you don't have to worry about anything going wrong.  MULTI_KEY
is available somewhere in the 82 archives on ticalc.org **OR** in the
What's New section (should be called the What's Old section :)  at Shining
Light Productions web site.

BTW, if you do use MULTI_KEY in your program, giving credit to Shining
Light Productions isn't required, although it would be nice :)


        Thomas J. Hruska -- shinelight@detroit.crosswinds.net
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://click-on.to/shinelight




References: