GetKey for the TI-89
Version 1.00 Public Release
by Jonathan Mendelson
MathJMendl@yahoo.com
http://ti89.n3.net

Introduction
Programming Example
Version History

Introduction:

Hello.  GetKey is a simple programming utility that allows you to find the key value for any key.  If you are new to programming the TI-89, when a key is being pressed, the key value becomes a certain number, unique to that key.  When no key is being pressed, the key value is 0.  Key values can be implemented into programs in many ways and are usually necessary in types of programs such as games (they are necessary if you want to be able to push keys and do things in programs other than receive input in the form of text).  To see an example of how the key values and the getkey() function (getkey() is not my program; it is a function built into the TI-89 that finds the key value of a key inside of a program; my program, gkey() uses getkey() to find and display key values so that getkey() can be used well in programs) can be implemented into programs read the programming example.  Don't hesitate to EMail me if you have any questions about this program or suggestions for new features for future versions (or even for other programming utilities) that might be useful.

Programming Example:

Here is an example of the programming usage of getkey() inside of a simple tunnel game that I've been writing to show you how one can use it inside of a program.  The 's denote the STO> key on the 89 that let you store values:

getKey()k
If k=337 Then
a-5a
ElseIf k=340 Then
a+5a
elseif k=264 then
goto e
EndIf

The getKey()k part, the first part of this code, stores the key value as the variable k (the way that the getkey() function is used).  The first part of the if, seeing if k=337, tests whether the left arrow key is being pushed, and if it is being pushed, subtracts 5 from the value of a, a varible that in this program holds the x-coordinate on the screen for the pointer.  Likewise,  340 is the value for the right arrow key and adds 5 to the x-coordinate if pushed.  So, basically, when the left key is pushed the pointer moves to the left and when the right key is pushed it is moved to the right (it is actually moved in a different section of the program, as this part of the program simply sets it up to be moved when it gets to that part).  The value for 264 is the value for the escape key, and when pushed, sends the program to the e part of the program, which ends it.  This is just one way that the getkey() function of the calculator can be used in order to get input, and again, gkey() (my program) lets you find these number values.

Version History:

March 8, 2000, Version 1.00:  Added a comment into the top of GetKey with authoring information and added explanation text for start of program.  Is first public release.