Re: [DOM 3 Events] Keyboard events feedback

* Erik Dahlström wrote:
>* Current spec doesn't take the current situation into account so it  
>creates just yet another system that implementors have to implement. Why  
>specify a brand new "textInput" event instead of specifying "keypress"  
>which everyone must support in any case? What is the interaction supposed  
>to be between the "textInput" event and the "keypress" event - in what  
>order do they fire, do both fire if one is cancelled by the script etc.?

While I was concerned that specifying legacy keyboard events in detail
would significantly delay the specification, the working group decided
about two years ago to add this to the specification. I believe Doug was
the last to try and write the specification text for it, but he is now
thirteen months overdue.

As for textInput, while certain key presses may result in textInput,
this process may be rather complex, and is in fact not the only way,
in some environments it may be preferable to bypass keyboard events if
the text is coming from the clipboard, handwriting, or speech input.

As for the complex process, your typical mobile phone provides a good
example, or you might want to use Opera on Windows and type into some
text box <SHIFT+b> <j> <f> <6> <ALT+x> <r> <n> and observe the events.

>* The really hard part, how to map a pressed key to a key identifier isn't  
>specified at all. All there is is "A.1.5 Guidelines for defining key  
>identifiers" which is non-normative and bascically says "do something that  
>seems logical".

That is for defining key identifiers. For many if not most useful keys
this is already done. I am not entirely sure what the problem is, it's
clear to me that pressing the "Mute" key on my keyboard would map to the
VolumeMute key identifier, and pressing the "->" key in "Right".

>* The javascript code for listening to key events will be unreadable  
>without an accompanying unicode list since evt.keyIdentifier will be  
>something like "U+XXXX".

Well there are some identifiers you might have to look up, just like you
might have to look up some attribute or method or language construct.
You might even find no key identifiers in the source at all, only some
variable name that stores some user-defined key identifier. You might
also have properly commented code that explains that U+0009 is a tab.
-- 
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 Monday, 14 April 2008 21:27:48 UTC