[Forwarding to the webapi folks an edited version of an earlier message to i18n]

http://www.w3.org/TR/DOM-Level-3-Events/keyset.html

One thing I currently don't have a clear grasp of is the following:

The DOM appendix A gives an example of pressing the key engraved with Q on a US 
physical kbd with a serbian mapping applied.  The example quotes the result as 
"keydown": "U+0409".  How is the implementation supposed to figure out that the 
appropriate identifier is U+0409, when all the tests I've done have returned 
the 81 (Q) result.

Does the implementation have tables for every keyboard mapping and every 
physical keyboard, and use those to map the codes coming from the keyboard into 
the right identifier?  Is so, how would it handle user customised keyboards in 
an interoperable way?  Or is it using the textInput value to work this out? 
Wouldn't it be better to just go with the codes sent by the keyboard to 
identify a key without trying to figure out what the character was?

RI 


PS: 
I wrote a small web app to help me.  It shows what current browsers do when you 
hit a key wrt assignments to .keyCode and .charCode on a keyDown, keyUp or 
keyPress event. (See http://people.w3.org/rishida/utils/keyevents/ if you're 
interested)

This produced different results from the Java app I had been using...  Eg. the 
Ukrainian keys that produced key codes of 0 (ie. ; ' [ ] etc) actually produce 
codes in browsers, but different codes depending on which browser you use. Eg. 
the ; key produces

                keydown keypress        keyup
Ie              186 (º)         1078 (ж)        186 (º) 
Ff              59 (;)          1078 (ж)        59 (;)
Opera           1046 (Ж)        1078 (ж)        1046 (Ж)
Safari  186 (º) 1078 (ж)        186 (º)


============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)
 
http://www.w3.org/People/Ishida/
http://www.w3.org/International/
http://people.w3.org/rishida/blog/
http://www.flickr.com/photos/ishida/
 


Reply via email to