PRGM GetKey
From WikiPrizm
Revision as of 18:00, 29 January 2012 by Ahelper (talk | contribs) (moved Useful Keyboard Routines to PRGM GetKey: Dedicating this page to PRGM_GetKey and having all useful routines on one page like the syscall page)
PRGM_GetKey
This is a routine that is non-blocking, goes through the OS, and returns one key value: the very last one pressed. While it's slightly outdated, it is still commonly used for simple key checking.
Input: none
Output: int (key value)
int PRGM_GetKey(void){ unsigned char buffer[12]; PRGM_GetKey_OS( buffer ); return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 ); }