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

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

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Fri, 26 Oct 2012 12:59:01 +0200
Message-ID: <508A6CF5.1000709@lamouri.fr>
To: www-dom@w3.org
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?

>> Generally speaking, as long as modifiers happen in keys without a char
>> representation, 'key' would be the only way to know what's the final
>> value so to know the actual physical key value, we will need a new
>> attribute.
> 
> I'm still confused because you seem to conflate they key's physical
> position with its intended action - what exactly do you mean by
> "physical key value"?

I think we need to know both values.

> Apologies if we're talking past each other, you can take comfort in the
> fact that if we are, I'm probably making a fool of myself in public. ;-)

I doubt ;) I'm far from being clear I believe and I'm sorry about that.

Thanks,
--
Mounir
Received on Friday, 26 October 2012 10:59:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 26 October 2012 10:59:27 GMT