EasyManua.ls Logo

Texas Instruments TI-89 - Push_Getkey

Texas Instruments TI-89
1398 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
650
Appendix A: System Routines — Keyboard
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_getkey
Declaration:
void
push_getkey
(void)
Category(ies):
Keyboard
Description:
Pushes the current key code onto the estack, zero if no key is currently
held down.
Inputs:
None
Outputs:
For a listing of key codes, see
Appendix B
in the TI
-
92 Guidebook. Note
that in the standard include file, tiams.h, some keys are conditionally
defined differently on the TI
-
89 versus the TI
-
92 Plus. So, for example,
KB_LEFT is defined to have the value 0x151 when _92 is defined whereas
it has the value 0x152 if _89 is defined. The
push_getkey
routine will
always return the value 0x151 which is the remapped TI
-
92 Plus value.
Assumptions:
None
Side Effects:
May expand expression stack, cause heap compression, or throw an error.
Availability:
On AMS 1.05 and higher.
TI-89 / TI-92 Plus
Differences:
This routine remaps the TI
-
89 keys to match the TI
-
92 Plus. This is the
TI
-
BASIC GetKey routine and not the low level keyboard routine. Some of
the return values are different than those returned by
GKeyIn
or the event
handler.
See Also: pushkey, GKeyIn
Example:
This example routine waits for
¸
or
N
to be pressed. It returns TRUE
if
¸
was pressed, FALSE if
N
was pressed.
Boolean tKey( void )
{ Access_AMS_Global_Variables;
unsigned short key, result;
do {
push_getkey();
result = estack_to_ushort(top_estack, &key)
delete_expression( top_estack );
if (1 == result) {
if (KB_ENTER == key)
return TRUE;
if (KB_ESC == key)
return FALSE;
}
} while (TRUE);
}

Table of Contents

Other manuals for Texas Instruments TI-89

Related product manuals