Difference between revisions of "PRGM GetKey"

From WikiPrizm
Jump to navigationJump to search
m (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)
(No difference)

Revision as of 19:00, 29 January 2012

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 );
}