A question about key identifiers on non-alphabetic keyboards.

Hi DOM3 Events folks,

Sorry for my question.
To read Section 6.2.6 of the latest draft, I'm wondering how we should
select key identifiers for a Russian keyboard (and ones for
non-alphabetics scripts).

On a Russian keyboard with a phonetic Russian mapping (*1), the key
labeled 'Q' (in terms of US 101 keyboard) maps to the key identifiers
'Ê' (U+0439) (unmodified) and 'ê' (U+0419) (modified).
To follow this step, when we type the key labeled 'Q' (in terms of US
101 keyboard) and a control key, a user-agent should generate a
keyboard event whose key identifier is 'Ê' (U+0439) and ctrlKey is
true.
On the other hand, I assume many web applications use the following
snippet to handle control-key events.

  if (evt.key == "Q" && evt.ctrlKey == true) {
    // ...
  }

So, straight-forwardly implementing this key identifiers may cause
compatibility problems that web applications don't work with Russian
keyboards (and ones for non-alphabetic scripts).

(*1) http://en.wikipedia.org/wiki/Keyboard_layout#Russian

The simplest workaround is changing the key identifier to 'Q' when we
type a control key. Nevertheless, it is probably not compliant with
this description.
Another workaround is that a user-agent maps such control keys to a
key identifier defined in Section 6.2.7. Nevertheless, this workaround
doesn't work with the above code.
(Even though using the legacy attribute 'keyCode' can avoid this
problem, it is inconsistent across platforms as written in Section
5.2.7.)

Would it be possible to give me advices about solutions for this problem?

Thank you for your help in advance.

Regards,

Hironori Bono
E-mail: hbono@google.com

Received on Friday, 25 September 2009 07:28:36 UTC