Clarify the button value for mouse drag by mustaqahmed · Pull Request #34 · w3c/pointerevents · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the button value for mouse drag #34

Merged
merged 1 commit into from
Feb 8, 2016

Conversation

mustaqahmed
Copy link
Member

The current spec wording suggests that the |button| value indicates "the last button changed" (like MouseEvent). On the other hand, the current Edge behavior suggests that |button| is "the button change that triggered the current event". The latter makes more sense since it makes it easier to differentiate between

  • a pointermove fired through a button activity (chorded button press/release), and
  • a pointermove fired through a non-button change (position, tilt, pressure, etc).

This patch proposes a spec wording change based on the Edge behavior.

Issue #33

@mustaqahmed
Copy link
Member Author

@jacobrossi, please let me know if my proposed changes make the spec clearer or not.

@@ -319,26 +319,46 @@
<section>
<h3><dfn>Chorded Button Interactions</dfn></h3>
<div><p>Some pointer devices, such as mouse or pen, support multiple buttons. In the [[!DOM-LEVEL-3-EVENTS]] Mouse Event model, each button press produces a <code>mousedown</code> and <code>mouseup</code> event. To better abstract this hardware difference and simplify cross-device input authoring, Pointer Events do not fire overlapping <code>pointerdown</code> and <code>pointerup</code> events for <a data-lt="Chorded Button Interactions">chorded button presses</a> (depressing an additional button while another button on the pointer device is already depressed).</p>
<p>Instead, chorded button presses can be detected by inspecting changes to the <code>button</code> and <code>buttons</code> properties. The <code>button</code> and <code>buttons</code> properties are inherited from the [[!DOM-LEVEL-3-EVENTS]] <code>MouseEvent</code> interface. In order to facilitate differentiating button state transitions in any pointer event (and not just <code>pointerdown</code> and <code>pointerup</code>), the <code>button</code> property takes on a new value when no mouse buttons are depressed:</p>
<p>Instead, chorded button presses can be detected by inspecting changes to the <code>button</code> and <code>buttons</code> properties. The <code>button</code> and <code>buttons</code> properties are inherited from the [[!DOM-LEVEL-3-EVENTS]] <code>MouseEvent</code> interface with modified semantics and values; see the following sections for details.</p></div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest a subtle rewording from

interface with modified semantics and values; see the following sections for details.

to

interface, but with a change in semantics and values, as outlined in this section.

@patrickhlauke
Copy link
Member

...with apologies for possibly bikeshedding some wording there. Apart from that, I think it brings the point we're trying to make across. Would it also be possible to squash this before committing, once we settled on final wordings?

@RByers RByers self-assigned this Feb 5, 2016
@mustaqahmed mustaqahmed force-pushed the fix-button-desc branch 2 times, most recently from 1705d72 to 191b8f7 Compare February 5, 2016 16:11
@mustaqahmed
Copy link
Member Author

Hi Patrick:
Thanks for the careful look. Done with the suggested edits plus squashing, ptal.

</section>
</section>
<section>
<h2><dfn>The Primary Pointer</dfn></h2>
<div><p>In a multi-pointer (e.g. multi-touch) scenario, the <a href="#widl-PointerEvent-isPrimary"><code>isPrimary</code></a> property is used to identify a master pointer amongst the set of active pointers for each pointer type. Only a primary pointer will produce <a>compatibility mouse events</a>. Authors who desire single-pointer interaction can achieve this by ignoring non-primary pointers (however, see the note below on <a href="#multiple-primary-pointers">multiple primary pointers</a>).
<div><p>In a multi-pointer (e.g. multi-touch) scenario, the <a href="#widl-PointerEvent-isPrimary"><code>isPrimary</code></a> property is used to identify a master pointer amongst the set of active pointers for each pointer type. Only a primary pointer will produce <a>compatibility mouse events</a>. Authors who desire single-pointer interaction can achieve this by ignoring non-primary pointers (however, see the note below on <a href="#multiple-primary-pointers">multiple primary pointers</a>)</p></div>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stray "." after the closing </div> at the end

@patrickhlauke
Copy link
Member

LGTM (noting that one tiny stray ".")

@RByers RByers assigned patrickhlauke and unassigned RByers Feb 6, 2016
@RByers
Copy link
Contributor

RByers commented Feb 6, 2016

Thanks for the review @patrickhlauke. I finally made time to take a look and it looks great to me (except for that trailing "." - otherwise I'd merge).

I'm out for a week and a half, Patrick can you please merge this once that last issue is fixed?

@mustaqahmed
Copy link
Member Author

Done moving the '.' to the para before.

@mustaqahmed
Copy link
Member Author

Fixed the second '.' outside the para, yikes! Sorry for the oversight!

@patrickhlauke
Copy link
Member

Lovely, thank you 👍

patrickhlauke added a commit that referenced this pull request Feb 8, 2016
Clarify the button value for mouse drag, and how it differs from mouse events/dom level 3
@patrickhlauke patrickhlauke merged commit e5cbdde into w3c:gh-pages Feb 8, 2016
@mustaqahmed mustaqahmed deleted the fix-button-desc branch February 9, 2016 19:22
@mustaqahmed mustaqahmed restored the fix-button-desc branch February 9, 2016 19:22
@mustaqahmed mustaqahmed deleted the fix-button-desc branch March 4, 2016 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants