changeset 5633:15f5f2930c25

RT-33969: Mac: Input method composition does not suppress KeyTyped events Reviewed-by anthony, zvegintsev
author Petr Pchelko <petr.pchelko@oracle.com>
date Tue, 05 Nov 2013 12:30:39 +0400
parents bbed405cc8bd
children a562ec0058ee
files modules/graphics/src/main/native-glass/mac/GlassView3D.m
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/mac/GlassView3D.m	Mon Nov 04 22:25:37 2013 -0800
+++ b/modules/graphics/src/main/native-glass/mac/GlassView3D.m	Tue Nov 05 12:30:39 2013 +0400
@@ -211,7 +211,7 @@
         [self addTrackingArea: self->_trackingArea];
         self->nsAttrBuffer = [[NSAttributedString alloc] initWithString:@""];
         self->imEnabled = NO;
-        
+        self->shouldProcessKeyEvent = YES;
     }
     return self;
 }
@@ -457,12 +457,11 @@
 {
     KEYLOG("keyDown");
     [GlassApplication registerKeyEvent:theEvent];
-    shouldProcessKeyEvent = YES;
-    [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
 
-    if (shouldProcessKeyEvent) { 
+    if (![[self inputContext] handleEvent:theEvent] || shouldProcessKeyEvent) {
         [self->_delegate sendJavaKeyEvent:theEvent isDown:YES]; 
     }
+    shouldProcessKeyEvent = YES;
 }
 
 - (void)keyUp:(NSEvent *)theEvent
@@ -677,6 +676,9 @@
 - (void)doCommandBySelector:(SEL)aSelector
 {
     IMLOG("doCommandBySelector called ");
+    // In case the IM was stopped with a mouse and the next typed key
+    // is a special command key (backspace, tab, etc.)
+    self->shouldProcessKeyEvent = YES;
 }
 
 - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange