Author: manolo
Date: 2012-12-26 06:02:59 -0800 (Wed, 26 Dec 2012)
New Revision: 9777
Log:
Mac OS text input: corrected processing of arrow keys during character
composition.
Modified:
branches/branch-1.3/src/Fl_cocoa.mm
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2012-12-26 12:17:52 UTC (rev 9776)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-12-26 14:02:59 UTC (rev 9777)
@@ -1703,6 +1703,7 @@
}
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent
{
+ int handled = 1;
//NSLog(@"performKeyEquivalent:");
fl_lock_function();
cocoaKeyboardHandler(theEvent);
@@ -1713,7 +1714,15 @@
s = [s uppercaseString]; // US keyboards return lowercase letter in s if
cmd-shift-key is hit
}
if ([s length] >= 1) [FLView prepareEtext:s];
- int handled = Fl::handle(FL_KEYBOARD, window);
+ if ( (mods & NSControlKeyMask) || (mods & NSCommandKeyMask) ) {
+ handled = Fl::handle(FL_KEYBOARD, window);
+ }
+ else {
+ in_key_event = YES;
+ NSText *edit = [[theEvent window] fieldEditor:YES forObject:nil];
+ [edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
+ in_key_event = NO;
+ }
fl_unlock_function();
return (handled ? YES : NO);
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit