@@ -497,14 +497,17 @@ - (void)keyUp:(NSEvent*)event {
497
497
[self .flutterViewController keyUp: event];
498
498
}
499
499
500
- // Invoked through NSWindow processing of key down event. This can be either
501
- // regular event sent from NSApplication with CMD modifier, in which case the
502
- // event is processed as keyDown, or keyboard manager redispatching the event
503
- // if nextResponder is NSWindow, in which case the event needs to be ignored,
504
- // otherwise it will cause endless loop.
505
500
- (BOOL )performKeyEquivalent : (NSEvent *)event {
506
501
if (_flutterViewController.keyboardManager .eventBeingDispatched == event) {
507
- // This happens with cmd+contorl+space (emoji picker)
502
+ // When NSWindow is nextResponder, keyboard manager will send to it
503
+ // unhandled events (through [NSWindow keyDown:]). If event has has both
504
+ // control and cmd modifiers set (i.e. cmd+control+space - emoji picker)
505
+ // NSWindow will then send this event as performKeyEquivalent: to first
506
+ // responder, which is FlutterTextInputPlugin. If that's the case, the
507
+ // plugin must not handle the event, otherwise the emoji picker would not
508
+ // work (due to first responder returning YES from performKeyEquivalent:)
509
+ // and there would be endless loop, because FlutterViewController will
510
+ // send the event back to [keyboardManager handleEvent:].
508
511
return NO ;
509
512
}
510
513
[self .flutterViewController keyDown: event];
0 commit comments