PRGM GetKey

From WikiPrizm
Jump to navigationJump to search

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