Re: specification of "legacy" key events

* Hallvord R. M. Steen wrote:
>>> 	* If the key does not cause text input and is not the Escape key (i.e.  
>>> if
>>> the key is not is an alphanumerical key, a punctuation key, a repeated
>>> press of a dead key or the Escape key), terminate this algorithm.

>Can you help me rephrase it? As you see I'm trying to pin down what key  
>input exactly should cause keypress events. I think it makes sense to say  
>something to the effect of "input that generates text" or "input that  
>would generate text if the target was an editable element" - with an  
>exception that also includes Esc because all browsers do that.

There are several posibilities, it could be defined in relation to text-
Input, it could be a default action of the keydown event, you could have
some external character input event, similar to an external mouse move-
ment event, which would pretty much amount to saying, it occurs when the
user enters text, and so on. Simply dropping the "i.e." clause would be
a good first step. I note that there need not be keys involved at all,
you might be using a tablet computer and input text via handwriting.

Obviously picking good text here depends on how other issues are handled
like whether preventing the default action of the keydown event prevents
the keypress, hence my point about solving the issues before writing the
specification text.

>> Further, some keys may generate multiple keydown events, for example,
>> the AltGr key on my keyboard will generate sequences of CTRL and Menu
>> keydown events;
>
>This indeed happens in Opera and Safari (Win), but not in IE and Firefox..  
>If browsers are inconsistent and we can assume no web content relies on  
>this can the spec ignore that detail? :-p

This very much happens in Internet Explorer on Windows on my system, but
sure, you can leave undefined whatever you like, so long as you point
out what is undefined. My intent was simply to point out exceptions to
the rules you were giving (without allowing for those exceptions).

>> also, you may hold some keys down without any repetition
>> (e.g., hold a, additionally hold shift, release shift; you are holding
>> the a key but don't get events for that).
>
>Yes, I do. IE, Firefox and Safari generate repeated keydown events, Opera  
>repeated keypress events. My spec text should be fixed to say fire  
>repeated keydown events if the key does not generate key press events..

I think you misread what I said. The point is, if you do the sequence
above, you will be holding a key down, but won't get any events from
Windows, until you press other keys, or release the key you are holding.
Your text required events when a key is pressed down, so the current
behavior of Windows and therefore most browsers would be non-compliant.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Friday, 16 May 2008 01:39:28 UTC