- if(bEOTriggered)
- break;
- bEOTriggered = true;
- }
-/*
- wxString msg;
- int cookie;
- CFNumberGetValue(
- (CFNumberRef) CFDictionaryGetValue ( (CFDictionaryRef) Array[i]
- , CFSTR(kIOHIDElementCookieKey)
- ),
- kCFNumberIntType,
- &cookie
- );
-
- msg << wxT("KEY:") << nUsage << wxT("COOKIE:") << cookie;
- wxLogDebug(msg);
-*/
-
- if (nUsage >= kHIDUsage_KeyboardA && nUsage <= kHIDUsage_KeyboardZ)
- AddCookie(Array[i], 'A' + (nUsage - kHIDUsage_KeyboardA) );
- else if (nUsage >= kHIDUsage_Keyboard1 && nUsage <= kHIDUsage_Keyboard9)
- AddCookie(Array[i], '1' + (nUsage - kHIDUsage_Keyboard1) );
- else if (nUsage >= kHIDUsage_KeyboardF1 && nUsage <= kHIDUsage_KeyboardF12)
- AddCookie(Array[i], WXK_F1 + (nUsage - kHIDUsage_KeyboardF1) );
- else if (nUsage >= kHIDUsage_KeyboardF13 && nUsage <= kHIDUsage_KeyboardF24)
- AddCookie(Array[i], WXK_F13 + (nUsage - kHIDUsage_KeyboardF13) );
- else if (nUsage >= kHIDUsage_Keypad1 && nUsage <= kHIDUsage_Keypad9)
- AddCookie(Array[i], WXK_NUMPAD1 + (nUsage - kHIDUsage_Keypad1) );
- else switch (nUsage)
- {
- //0's (wx & ascii go 0-9, but HID goes 1-0)
- case kHIDUsage_Keyboard0:
- AddCookie(Array[i],'0');
- break;
- case kHIDUsage_Keypad0:
- AddCookie(Array[i],WXK_NUMPAD0);
- break;
-
- //Basic
- case kHIDUsage_KeyboardReturnOrEnter:
- AddCookie(Array[i], WXK_RETURN);
- break;
- case kHIDUsage_KeyboardEscape:
- AddCookie(Array[i], WXK_ESCAPE);
- break;
- case kHIDUsage_KeyboardDeleteOrBackspace:
- AddCookie(Array[i], WXK_BACK);
- break;
- case kHIDUsage_KeyboardTab:
- AddCookie(Array[i], WXK_TAB);
- break;
- case kHIDUsage_KeyboardSpacebar:
- AddCookie(Array[i], WXK_SPACE);
- break;
- case kHIDUsage_KeyboardPageUp:
- AddCookie(Array[i], WXK_PRIOR);
- break;
- case kHIDUsage_KeyboardEnd:
- AddCookie(Array[i], WXK_END);
- break;
- case kHIDUsage_KeyboardPageDown:
- AddCookie(Array[i], WXK_NEXT);
- break;
- case kHIDUsage_KeyboardRightArrow:
- AddCookie(Array[i], WXK_RIGHT);
- break;
- case kHIDUsage_KeyboardLeftArrow:
- AddCookie(Array[i], WXK_LEFT);
- break;
- case kHIDUsage_KeyboardDownArrow:
- AddCookie(Array[i], WXK_DOWN);
- break;
- case kHIDUsage_KeyboardUpArrow:
- AddCookie(Array[i], WXK_UP);
- break;
-
- //LEDS
- case kHIDUsage_KeyboardCapsLock:
- AddCookie(Array[i],WXK_CAPITAL);
- break;
- case kHIDUsage_KeypadNumLock:
- AddCookie(Array[i],WXK_NUMLOCK);
- break;
- case kHIDUsage_KeyboardScrollLock:
- AddCookie(Array[i],WXK_SCROLL);
- break;
-
- //Menu keys, Shift, other specials
- case kHIDUsage_KeyboardLeftControl:
- AddCookie(Array[i],WXK_CONTROL);
- break;
- case kHIDUsage_KeyboardLeftShift:
- AddCookie(Array[i],WXK_SHIFT);
- break;
- case kHIDUsage_KeyboardLeftAlt:
- AddCookie(Array[i],WXK_ALT);
- break;
- case kHIDUsage_KeyboardLeftGUI:
- AddCookie(Array[i],WXK_MENU);
- break;
- case kHIDUsage_KeyboardRightControl:
- AddCookie(Array[i],WXK_RCONTROL);
- break;
- case kHIDUsage_KeyboardRightShift:
- AddCookie(Array[i],WXK_RSHIFT);
- break;
- case kHIDUsage_KeyboardRightAlt:
- AddCookie(Array[i],WXK_RALT);
- break;
- case kHIDUsage_KeyboardRightGUI:
- AddCookie(Array[i],WXK_RMENU);
- break;
-
- //Default
- default:
- //not in wx keycodes - do nothing....
- break;
- }
- }
+ //0's (wx & ascii go 0-9, but HID goes 1-0)
+ case kHIDUsage_Keyboard0:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), '0');
+ break;
+ case kHIDUsage_Keypad0:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_NUMPAD0);
+ break;
+
+ //Basic
+ case kHIDUsage_KeyboardReturnOrEnter:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_RETURN);
+ break;
+ case kHIDUsage_KeyboardEscape:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_ESCAPE);
+ break;
+ case kHIDUsage_KeyboardDeleteOrBackspace:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_BACK);
+ break;
+ case kHIDUsage_KeyboardTab:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_TAB);
+ break;
+ case kHIDUsage_KeyboardSpacebar:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_SPACE);
+ break;
+ case kHIDUsage_KeyboardPageUp:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_PAGEUP);
+ break;
+ case kHIDUsage_KeyboardEnd:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_END);
+ break;
+ case kHIDUsage_KeyboardPageDown:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_PAGEDOWN);
+ break;
+ case kHIDUsage_KeyboardRightArrow:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_RIGHT);
+ break;
+ case kHIDUsage_KeyboardLeftArrow:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_LEFT);
+ break;
+ case kHIDUsage_KeyboardDownArrow:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_DOWN);
+ break;
+ case kHIDUsage_KeyboardUpArrow:
+ AddCookie(CFArrayGetValueAtIndex(Array, i), WXK_UP);
+ break;
+
+ //LEDS
+ case kHIDUsage_KeyboardCapsLock:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_CAPITAL);
+ break;
+ case kHIDUsage_KeypadNumLock:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_NUMLOCK);
+ break;
+ case kHIDUsage_KeyboardScrollLock:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_SCROLL);
+ break;
+
+ //Menu keys, Shift, other specials
+ case kHIDUsage_KeyboardLeftControl:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_CONTROL);
+ break;
+ case kHIDUsage_KeyboardLeftShift:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_SHIFT);
+ break;
+ case kHIDUsage_KeyboardLeftAlt:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_ALT);
+ break;
+ case kHIDUsage_KeyboardLeftGUI:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_MENU);
+ break;
+ case kHIDUsage_KeyboardRightControl:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RCONTROL);
+ break;
+ case kHIDUsage_KeyboardRightShift:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RSHIFT);
+ break;
+ case kHIDUsage_KeyboardRightAlt:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RALT);
+ break;
+ case kHIDUsage_KeyboardRightGUI:
+ AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RMENU);
+ break;
+
+ //Default
+ default:
+ //not in wx keycodes - do nothing....
+ break;
+ } //end mightly long switch
+ } //end if the current element is not an array...
+ } //end for loop for Array