Comment #11 on issue 15090 by [email protected]: While ⌘ key held down,  
letter keys don't generate key events
http://code.google.com/p/chromium/issues/detail?id=15090

Here's what's going on:

Command keys are handled differently than any other type of keystroke. While
experienced Carbon hands would expect that command keys would propagate  
like any
other key event, and that when it hit the application event handler would  
be turned
into a menu event, that's not the case at all.

Command keys are handled by sending them down the performKeyEquivalent:  
call on the
view. If no one handles it then it is processed by the menu.

WebKit handles it in WebHTMLView.mm, where they send the event to WebCore,  
and only
pass it through if it wasn't handled. We can't quite do that since we have  
IPC to do.

The plan is, then, in RWHV to always return YES to performKeyEquivalent:  
(to indicate
we're handling the event) and then to pass it to WebCore. When TCV gets the  
message
to handle an unhandled event from WebCore, it will set a flag around a call  
to
process the event:

processingKeyEquivalent_ = YES;
[NSApp sendEvent:event]
processingKeyEquivalent_ = NO;

and then have a performKeyEquivalent: override in TCV that just returns NO  
if
processingKeyEquivalent is YES, so that we don't infinitely loop.

In implementing this idea, I found that WebCore actually eats ⌘-C if it  
sees it. It's
never had the chance to in Chromium before, so we were triggering the menu  
which
fires off an editor action. But if we actually route command key events  
into WebCore,
deep down it eats the ⌘-C and does a paste, which is very surprising. From  
the WebKit
code, it would seem that it wouldn't do that, but it is. I'm still digging  
up what's
going on.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to