mb_check_keyboard

Previous  Next

 

status_t mb_check_keyboard( short int* pKey, short int break_key )

 


 

This function calls the default keyboard handler to check if a key has been pressed and returns the key in the pKey argument.  You can supply a break key and if the break key has been pressed, the handler will return MB_FUNC_BYE otherwise the function returns MB_FUNC_OK.  If an error occurs, the function will return MB_FUNC_ERR.

 

This function shouldn't be called directly.  Instead you should rely on the current keyboard handler and use this together with mb_set_check_keyboard_handler if you don't want to supply your own custom keybaord handler.

 

Example

 

short int key = 0;

 

if ( (  mb_check_keyboard( &key, 0 ) == MB_FUNC_BYE ) || ( key == 3 ) )

{

  return MB_FUNC_BYE;

}