Re: [DOM3Events] Pointer Events request to change DOM 3 Events "button" type

From: Bjoern Hoehrmann <derhoermi@gmx.net>
>* Travis Leithead wrote:
>>Nothing else in the DOM Level 3 Events spec would change (except perhaps 
>>some clarifying statements that mouse events only ever return values of 
>>0 or greater for the button attribute.
>
> http://www.w3.org/TR/2013/WD-pointerevents-20130115/ proposes "In order
> to facilitate differentiating button state transitions in any pointer
> event (and not just pointerdown and pointerup), the button property
> takes on a new value when no mouse buttons are depressed" specifically
> the value -1 would be for "Mouse move with no buttons pressed". So, for
> 'mousemove' with no button pressed you will get MouseEvent.button == 0,
> while for "pointer events" you get MouseEvent.button == -1?

Trusted mouse* events will not change (preserving compat).  So for a mousemove, you'll get 0. But for pointermove you would get -1. I added a quick note to the pointer events spec to clarify this: https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEvents.html#chorded-button-interactions

But because the PointerEvent interface inherits from MouseEvent, the property needs to be defined as unsigned to allow the pointermove case.

From: Anne van Kesteren <annevk@annevk.nl>
> Easiest I think would be to just fix it in the UI Events specification
> and make the world refer to that and either forgot about DOM3 Events
> or publish it quickly for the patent police.

Should be a pretty inconsequential change for DOM L3 Events. Adding Olli because he indicated he preferred DOM L3 Events.

-Jacob

Received on Monday, 21 January 2013 23:13:10 UTC