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

On Fri, Oct 26, 2012 at 2:59 PM, Mounir Lamouri <mounir@lamouri.fr> wrote:

> On 10/26/2012 09:10 AM, Hallvord R. M. Steen wrote:
> > Mounir Lamouri <mounir@lamouri.fr> skreiv Thu, 25 Oct 2012 18:50:55
> +0200
> >> However, I think we should use a new attribute instead of 'key'.
> >> Otherwise, on my laptop, it would be hard to know what this would be
> >> doing:
> >> { char: '', key: 'Home' }
> >> it could be the 'Home' key or the 'BrightnessUp' depending on my
> >> pressing 'Fn' or not.
> >
> > But this has nothing to do with identifying the "physical key". The
> > "key:Home" property does a pretty good job at that (if we spec it like I
> > think we agree we should, i.e. disregarding modifier keys - that
> > presumably includes Fn).
> >
> > Here you seem to be looking for a way to determine what the key would do
> > if the script did not interfere, sort of like an event.nativeShortcut
> > property. That seems like a very different use case to me.
> >
> > In general, the OS or platform will always be able to filter out and
> > respond to some keypresses, like Fn+function keys or ctrl-alt-delete, we
> > probably can't demand that a web app should be able to respond to
> > absolutely every key combination.
>
> My issue isn't with the key event not being sent to the web application.
> Let say the OS is Web based and I'm writing an application that handles
> the screen brightness, I want to know when the 'BrightnessUp' or
> 'BrightnessDown' keys are pressed. However, if 'key' always gives me the
> physical key, I will only get 'Home' and 'End' even if 'Fn' was pressed.
> I think the correct way here is to say that the physical key is whether
> 'Home' or 'End' and the key value is 'BrightnessUp' or 'BrightnessDown'.
>  Am I clearer?
>
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.

And the API to detect all possible values of "key" property would be the
great solution, but only for specific cases.

Received on Friday, 26 October 2012 12:24:36 UTC