diff options
author | Aaron Skomra <skomra@gmail.com> | 2012-03-07 22:53:57 -0800 |
---|---|---|
committer | Aaron Skomra <skomra@gmail.com> | 2012-03-07 22:53:57 -0800 |
commit | 94113ffa39b59a6841d442e4d8a13332111aa9a0 (patch) | |
tree | 5e901e929d90f82b2438cd5f5bc0b47158b80953 /src/xtoq/XtoqController.m | |
parent | 593b5e76d2c676e9c7540f43c02516940b9b7b31 (diff) |
controller now sends xtoq_key_press and xtoq_key_release on receiving keyDown from view
Diffstat (limited to 'src/xtoq/XtoqController.m')
-rw-r--r-- | src/xtoq/XtoqController.m | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m index ae6cd96..15808d2 100644 --- a/src/xtoq/XtoqController.m +++ b/src/xtoq/XtoqController.m @@ -180,21 +180,19 @@ NSDictionary *keyInfo = [aNotification userInfo]; // note this keyInfo is the key in <key, value> not the key pressed NSEvent * event = [keyInfo objectForKey: @"1"]; - //NSLog(@"Controller Got a XTOQviewKeyDownEvent key %@", [event characters]); unsigned short aChar = [event keyCode]; NSString* charNSString = [event characters]; const char* charcharstar = [charNSString UTF8String]; - //printf( "\n--------------------------------------------\n" ); - // translate key here code = translate(charcharstar); - NSLog(@"%s pressed", charcharstar); - //uint8_t code = (unsigned char)0x10; - //uint8_t code = - dispatch_async(xtoqDispatchQueue, + NSLog(@"%s pressed", charcharstar); + dispatch_async(xtoqDispatchQueue, ^{ xtoq_key_press(rootContext, (int)[event windowNumber], aChar + 8) ;}); - + dispatch_async(xtoqDispatchQueue, + ^{ xtoq_key_release(rootContext, + (int)[event windowNumber], + aChar + 8) ;}); } |