So I've been dabbling in this TI-BASIC stuff for a while now, but only recently have I started doing actual cool stuff. Yesterday I was fooling around, trying to make a program where pressing arrow keys would move an object on the screen. I have the loop set up so that it waits for a key to be pressed, but I don't know how to make it recognize an arrow key being pressed. Anyone feel like helping a poor noob out?
What you need it the getKey command. GetKey is the 7th in the I/O menu, or in the Catalog. It returns a value determined by the row and column.
You can refer to that picture to check the getKey values of keys.
Alternatively, if you spend more time on your calc than online, run this program and it should work.
:Repeat Ans=45 :Repeat Ans :getKey :End :ClrHome :Output(1,1,Ans :End
It will await you for pressing a key, then display it's getkey value. Please note that it will not display On, as On breaks, and that it will quit when you hit Clear (getKey 45).
As for a custom menu, I've here's code for one that I use:
:ClrHome :1+iPart(length(Str1)/16→D :Output(1,1,Str1 :2→X :Ans→Y :While 1 :Output(X,2," " :Output(Y,2,"> :Repeat Ans :getKey→A :End :If Ans=22 or Ans=45 :Stop :Y→X :If A=21 or A=105 or A=26 :Then :X-1→X :ClrHome :Output(1,1," :Return :End :Y-(A=25)+(A=34→Y :2(Y>D)+D(Y<2)+Y((D+1)≠Y and Y>1→Y :End
It takes an input of Str1. To use it, store what the menu will look like through an "Output(1,1,Str1)". It may take some trial and error to get it right. It will move with the up/down; Clear Stops everything; and right, enter, and 2nd will select it. The # Choice is stored to X. It is pretty optimized, so if you want I can explain it.