DOM3 Key Events + accelerator keys

Hi Everyone,
   It seems that DOM3 is rather silent on the topic of accelerator keys.

Obviously the spec should not (cannot?) define accelerators, but we  
would ideally have some kind of specification to define what events  
should be fired, and whether they should be allowed to prevent  
default handling, etc.  It is these that it would be good to define.

A brief examination of Firefox, IE7, Safari 3 beta and Opera 9.5  
indicates that keydown and keyup are fired in all browsers other than  
Firefox3/Mac and Safari3/Mac (neither of which fire any keyup  
events), with individual keydowns and keyups sent for the ctrl (or  
cmd) key and the accelerator key (i was testing with the copy key, so  
the accelerator was 'c').

Only WebKit's output had a valid keyIdentifier, but it used the  
unicode sequence U+0043, rather than "Copy" which is probably what is  
expected :-/

In all browsers that send a keypress when an accelerator exists  
(basically every browser other than IE) the accelerator occurs after  
the keypress event has been fired.

Finally, event.preventDefault() (and equivalents) will prevent  
accelerators from firing in both Safari and Firefox, but not in Opera  
or IE.

Anyhoo, I figured it would be good to have a defined behaviour to  
make it easier for developers of complex webapps with better  
accelerator handling.

--Oliver

Received on Tuesday, 25 September 2007 05:50:04 UTC