The getKey command is a command that gets a keypress and stores the information to a variable. This is useful if you have interactive graphics, or many other things. The command looks like this:
:getKey->D
First, you need to know how the keyboard is mapped out. The tens go from the top row down, starting with 10 and ending with 100. Ones go across to the right, and start with 1 (not 0!), and end with 5. It may be a little confusing, but here are some examples:
Y= (11).....Graph (15).....Enter (105).....2nd (21).....Alpha (31).....Apps (42)
So, find the coordinates of the Math key. You should have gotten 41. Next, try to find the coordinates of the 1 key. It should be 92. There are five exceptions to this:
The On key (You can't use this during a program or else it breaks it. This has no mapping).....Left Arrow (24).....Up Arrow (25).....Right Arrow (26).....Down Arrow (34)
However, getKey doesn't wait for you to press a key. If you don't have a key pressed, it skips over everything. So, how do you have it wait until you press a key? (Note, sometimes you don't want to do this, so just leave out the following lines of code).
:0->D
:While D=0
:getKey->D
:End
And here you go on to...
:If D=24
:BlahBlahBlah...
| The Key Program |