[webkit-dev] Keypress event for ctrl+key and/or ⌘+key?

Erik Arvidsson arv at chromium.org
Mon Oct 19 19:43:07 PDT 2009


On Mon, Oct 19, 2009 at 18:03, Oliver Hunt <oliver at apple.com> wrote:
> On Oct 19, 2009, at 5:18 PM, Erik Arvidsson wrote:
>
>> I'm trying to clean up some inconsistencies with when keypress events
>> are dispatched.
>>
>> WebKit's key event model is modeled to be compatible with Internet
>> Explorer and Internet Explorer does not fire keypress for Ctrl+key [1]
>
> The key event model was designed to be as compatible as possible with both
> IE and firefox, so it would be helpful to know the firefox behaviour.

Firefox fires keypress events for everything.

>> Safari Win does not fire any keypress events when ctrl is held down
>> Safari Mac fires keypress events when command is held down
>> Safari Mac fires keypress events when ctrl is held down
>>
>> Chromium Win fires keypress events for some keys when ctrl is held down
>> Chromium Linux fires keypress events for some keys when ctrl is held
>> down (matches chromium windows)
>> Chromium Mac does not fire keypress events when command is held down
>> Chromium Mac does not fire keypress events when ctrl is held down
>>
>> There are two possible solutions to this problem.
>>
>> 1. Always fire keypress events no matter what modifiers are held down
>> 2. Do not fire keypress events unless content would be generated
>
> Expected behaviour is for key events to be sent regardless of ctrl/command
> pressed.
>
> The real issue is whether application shortcuts get precedence over DOM
> event handlers, currently on mac the DOM event handlers get precedence (and
> thus the ability to override/prevent application shortcuts) and on windows
> they don't.  This is entirely a byproduct of implementation and the
> difference really isn't something we want.
>
> --Oliver

I think we should try to enable firing keypress events on Windows
again and see if it leads to any troubles.

-- 
erik


More information about the webkit-dev mailing list