CPUTKey MapKey(cString strKey) { for(int i = 0; i < KEY_NUM_KEYS; i++) { if( 0 == strKey.compare(CPUTKeyMap[i].name)) return CPUTKeyMap[i].value; } DEBUG_PRINT(_L("Unknown Key: %s"), strKey.c_str()); return KEY_NUM_KEYS; }
int GetEventValue(StringMap eventMap[], cString event) { int i = 0; while(eventMap[i].value > 0) { if(event.compare(eventMap[i].key) == 0) { DEBUG_PRINT(_L("Found Event: %s\n"), event.c_str()); return eventMap[i].value; } i++; } return -1; }