W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2012

Re: [DOM3Events] Comments on DOM Level 3 key events

From: Егор Николаев <termi1uc1@gmail.com>
Date: Fri, 26 Oct 2012 17:29:19 +0400
Message-ID: <CAP=KyThxDKZcTO7zoJaaqf+Ymx-3z6ByVJG3TOSOuTLHSK-n0g@mail.gmail.com>
To: www-dom@w3.org
Cc: Mounir Lamouri <mounir@lamouri.fr>
On Fri, Oct 26, 2012 at 4:56 PM, Mounir Lamouri <mounir@lamouri.fr> wrote:

> On 10/26/2012 02:24 PM, Егор Николаев wrote:
> > I must say that my original issue was only about alphabetical "key"
> > value with or without special keys (Shift, Crtl,...).
> > In this case, key='BrightnessUp' if 'Fn' was pressed and key='Home' if
> > 'Fn' was not pressed would be good enough.
>
> Having special use cases for some keys is unlikely a good idea. It would
> be hard to understand. Also, one of the use cases if apps that want to
> know at a given time which physical keys are pressed. This is not only
> for keys with a character representation I believe.
>
I believe you misunderstand me. I mean API for determined all possible
values of "key" property would be great for any given "abstract key" but it
less important for web application than possibility to cross-locale
shortcut detection, no matter if it one-key or two-key (or more) shortcut.
For example, our company supported six-language interface: Russian,
Byelorussian, Ukrainian, English, Kazakh, Uzbek. So for keys shortcut
detection in new API (draft
http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120906/) I need to write:
```javascript
keyboardKeyUpHandler(e) {
  if(e.ctrlKey) {
    var key =  e.key.toLowerCase();
    if(key == "v"/*en_US*/ || key == "м"/*ru_RU*/ || key == <...>) {//and
so on for be_BY, uk_UA, kk_KZ, uz_UZ
      //"copy-past" past action
    }
  }
}
```
It's very frustrations so I am personally prefer good-old "keyCode ||
charCode" technique

Regards
Received on Friday, 26 October 2012 13:29:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 26 October 2012 13:29:53 GMT