diff options
| author | Manolo Gouy <Manolo> | 2012-12-26 14:02:59 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-12-26 14:02:59 +0000 |
| commit | 28a85d27e97add1050d68adacc1fccca4c582214 (patch) | |
| tree | d332144b34a1196f5a59bc116769292a369adff4 /src | |
| parent | a4c021e59517259779fa4f0a19652741dc0e81e5 (diff) | |
Mac OS text input: corrected processing of arrow keys during character composition.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 20733b974..b12794f7a 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1703,6 +1703,7 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi } - (BOOL)performKeyEquivalent:(NSEvent*)theEvent { + int handled = 1; //NSLog(@"performKeyEquivalent:"); fl_lock_function(); cocoaKeyboardHandler(theEvent); @@ -1713,7 +1714,15 @@ static void q_set_window_title(NSWindow *nsw, const char * name, const char *mi 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); } |
