W3C home > Mailing lists > Public > public-device-apis@w3.org > May 2012

Re: [sensors] the near/far event names

From: Jonas Sicking <jonas@sicking.cc>
Date: Sun, 13 May 2012 01:43:23 -0700
Message-ID: <CA+c2ei-Ahna54z1VM-7wQYMVrHE2EuOA9aUU637=q33FRy8rHw@mail.gmail.com>
To: Marcos Caceres <marcosscaceres@gmail.com>
Cc: "public-device-apis@w3.org" <public-device-apis@w3.org>
On Fri, May 11, 2012 at 10:26 AM, Marcos Caceres
<marcosscaceres@gmail.com> wrote:
> What about going with what Robin suggested:
>
> window.addEventListener("proximity", function(e){});
>
> And the Event:
>
> e.min ...
> e.max ...
> e.value ...
> e.proximity = "far" || "near" ?

Given that the by far most common use-case is likely to be to want
adjust application behavior based on near/far, I think it would be a
good design if we had an event just for that. This would prevent
getting lots of events all telling the author that the device is still
"near" the user's face. That will also minimize the risk of website
breakage if we ever transition to higher resolution sensors since the
near/far event wouldn't change at all.

But I would also be ok with simply keeping it simple and just sticking
the new property on the existing event. Though I don't think the event
should be optional since I don't see a reason why implementations
couldn't do a best-approximation implementation.

/ Jonas
Received on Sunday, 13 May 2012 08:44:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 13 May 2012 08:44:27 GMT