Difference between revisions of "PRGM GetKey"

From WikiPrizm
Jump to navigationJump to search
(Created page with '=== PRGM_GetKey === int PRGM_GetKey(){ unsigned char buffer[12]; PRGM_GetKey_OS( buffer ); return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 ); } [[Category: …')
 
Line 1: Line 1:
 
=== PRGM_GetKey ===
 
=== PRGM_GetKey ===
  int 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];
 
  unsigned char buffer[12];
 
  PRGM_GetKey_OS( buffer );
 
  PRGM_GetKey_OS( buffer );

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