- // backspace key
- case 0x7F :
- case 8 :
- retval = WXK_BACK;
- break;
- case NSUpArrowFunctionKey :
- retval = WXK_UP;
- break;
- case NSDownArrowFunctionKey :
- retval = WXK_DOWN;
- break;
- case NSLeftArrowFunctionKey :
- retval = WXK_LEFT;
- break;
- case NSRightArrowFunctionKey :
- retval = WXK_RIGHT;
- break;
- case NSInsertFunctionKey :
- retval = WXK_INSERT;
- break;
- case NSDeleteFunctionKey :
- retval = WXK_DELETE;
- break;
- case NSHomeFunctionKey :
- retval = WXK_HOME;
- break;
- // case NSBeginFunctionKey :
- // retval = WXK_BEGIN;
- // break;
- case NSEndFunctionKey :
- retval = WXK_END;
- break;
- case NSPageUpFunctionKey :
- retval = WXK_PAGEUP;
- break;
- case NSPageDownFunctionKey :
- retval = WXK_PAGEDOWN;
- break;
- case NSHelpFunctionKey :
- retval = WXK_HELP;
- break;
- default:
- int intchar = [s characterAtIndex: 0];
- if ( intchar >= NSF1FunctionKey && intchar <= NSF24FunctionKey )
- retval = WXK_F1 + (intchar - NSF1FunctionKey );
- break;
+ retval = WXK_CONTROL_A + ([s characterAtIndex:0] - 'a');
+ }
+ else
+ {
+ switch ( [s characterAtIndex:0] )
+ {
+ // backspace key
+ case 0x7F :
+ case 8 :
+ retval = WXK_BACK;
+ break;
+ case NSUpArrowFunctionKey :
+ retval = WXK_UP;
+ break;
+ case NSDownArrowFunctionKey :
+ retval = WXK_DOWN;
+ break;
+ case NSLeftArrowFunctionKey :
+ retval = WXK_LEFT;
+ break;
+ case NSRightArrowFunctionKey :
+ retval = WXK_RIGHT;
+ break;
+ case NSInsertFunctionKey :
+ retval = WXK_INSERT;
+ break;
+ case NSDeleteFunctionKey :
+ retval = WXK_DELETE;
+ break;
+ case NSHomeFunctionKey :
+ retval = WXK_HOME;
+ break;
+ // case NSBeginFunctionKey :
+ // retval = WXK_BEGIN;
+ // break;
+ case NSEndFunctionKey :
+ retval = WXK_END;
+ break;
+ case NSPageUpFunctionKey :
+ retval = WXK_PAGEUP;
+ break;
+ case NSPageDownFunctionKey :
+ retval = WXK_PAGEDOWN;
+ break;
+ case NSHelpFunctionKey :
+ retval = WXK_HELP;
+ break;
+ default:
+ int intchar = [s characterAtIndex: 0];
+ if ( intchar >= NSF1FunctionKey && intchar <= NSF24FunctionKey )
+ retval = WXK_F1 + (intchar - NSF1FunctionKey );
+ else if ( intchar > 0 && intchar < 32 )
+ retval = intchar;
+ break;
+ }