w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 52 forks source link

May the state of modifier keys influence MouseEvent.button? #184

Open jfirebaugh opened 6 years ago

jfirebaugh commented 6 years ago

Consider:

window.document.addEventListener('mousedown', e => console.log(e.button));

On the Mac, with default system settings for modifier keys, depressing the primary mouse button with the control key simultaneously depressed produces output that varies between browsers:

Does the spec have an opinion on which behavior is correct, or is this left as unspecified platform-dependent/browser-dependent behavior?

garykac commented 6 years ago

The spec does not currently have an opinion about behaviors where different browsers have some historical implementation differences. In general, we're working toward having a more algorithmic approach to specs (which will prevent these differences in the future), but UIEvents is an old spec that covers features with a lot of baggage that will be challenging to clean up.

However, we do want to (a) document the differences better, and if possible, (b) come to general agreement on what the behavior should be.

Thanks for the comment. I'm leaving this bug open to track updating the spec to provide a better description of how different browsers handle modifier keys for mouse clicks.