-
Notifications
You must be signed in to change notification settings - Fork 160
pointer cancel event with mouse buttons #166
Comments
Performing multiple button presses with a mouse is an interesting case because the action that you started may be canceled, depending on the order in which you release the buttons. For example, primary down, secondary down, secondary up, primary up will result in a click because the primary button was the first and last action. But primary down, secondary down, primary up, secondary up won't result in a click. Similarly secondary down, primary down, secondary up, primary up won't result in a click. In any case, the context menu would open on secondary down and close on the first up, regardless of which button is released. It's also impossible to detect when multiple mice are being used vs. a single mouse. However, I do agree that it seems odd for a |
It gets a little easier if you |
On my fork (Lowfab/PEP) I have made some changes to better match the behavior of the native implementation of IE regarding button states and also firing of pointerdown/up-events. The fork is probably not useful for a pull request, because I have also added the "binary" to be able to directly require the github repo as npm dependency, but feel free to copy my changes if you find them useful. |
We couldn't do that without a CLA. A PR would really help if you want your changes to be reviewed. I don't really think the team wants to dig through commits in your master branch. |
Done and done, see #168 |
Thanks! |
PEP has now entered emeritus status at the OpenJS Foundation. This repository is now archived. |
Maybe again my misunderstanding of the recommendation, but:
What I do:
I press one mouse button (and keep it pressed down), then press a second mouse button.
What I expect:
A pointerdown event is triggered with the first mouse button.
To detect the second mouse button I can inspect changes to the
button
/buttons
properties.What I get
A pointerdown event is trigerred with the first mouse button.
(So far no problems)
The second mouse button results in a pointercancel event and a new pointerdown event
which puzzles me. In my understanding I will only receive pointer events...
But the mouse already had a pressed button. (In contrast to "no buttons depressed")
One might argue, that the pointercancel event causes the mouse to leave the active buttons state and therefore a pointerdown event is correct. I just would not expect a pointercancel event in the first place, because I can't find any of the conditions met:
But the section is non-normative, so the polyfill can just decide, that a pointercancel event has to be fired. In this case I'd expect some more events:
But I don't receive any of those, but only the new pointerdown event.
Any hints on this issue?
The text was updated successfully, but these errors were encountered: