Difference between revisions of "PRGM GetKey"

From WikiPrizm
Jump to navigationJump to search
Line 4: Line 4:
  
 
Input: none
 
Input: none
 +
 
Output: int (key value)
 
Output: int (key value)
  

Revision as of 09:06, 21 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 );
}