wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/KeypadSound/KeyPadSetUSBEvent

Version 1 (modified by Don Wilson, 6 years ago) ( diff )

--

KeyPadSetUSBEvent

Set an event (callback) function to be called when character is received via USB keyboard.

void KeyPadSetUSBEvent(uint8 (*pUSBKeypadEvent)(uint 8 keyRcvd))

Parameters

uint8 (*pUSBKeypadEvent)(uint8 keyRcvd))

Return Value

  • void - does not return any value

Remarks

Applications must call OpenBeeper before the keypad or beeper devices may be used from the application. This function is useful if it is desired to disregard or modify certain characters received from an attached USB keyboard.

Examples

uint8 USBKeyRcvd(uint8 key)
{
   if(key >= 'a' && key <= 'z') // lower case key pressed
   { 
       return key - 'a' + 'A';  // convert to upper case
   }
   else
   {
       return key;
   }
}

void IndStartup(void)
{
    KeyPadSetUSBEvent(USBKeyRcvd);
    // ...

}

See Also

Note: See TracWiki for help on using the wiki.