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

Mouse button modifiers for "v-on" should have more precise aliases #6877

Open
st-sloth opened this issue Oct 22, 2017 · 3 comments
Open

Mouse button modifiers for "v-on" should have more precise aliases #6877

st-sloth opened this issue Oct 22, 2017 · 3 comments

Comments

@st-sloth
Copy link
Contributor

What problem does this feature solve?

Currently mouse button modifiers, introduced in #4866, are left, middle, right for $event.button values 0, 1, 2 correspondingly. But that is only correct for the "default" right-handed layout. In the left-handed mode (when the buttons are switched in the OS) the right button has 0 value and the left button - 2. Besides, also some right-handed users may reverse or remap the mouse buttons. And working with code with these names for mouse buttons may lead to confusion and bugs among developers not familiar with the "default" right-handed mode being the target for these modifiers.

What does the proposed API look like?

Keep left and right as deprecated and add main and secondary as their aliases.

@st-sloth
Copy link
Contributor Author

I am currently working on it. What names should the modifiers really have?

  1. Since the "mouse" modifiers for left and right have already clashed with keyboard modifiers left and right (v-on:keydown.right and left seems to be broken in Vue 2.2.1 #5046, fix mouse modifier override the keycode ( Fixed #5046 ) #5060), and to avoid such future name issues, should we perhaps include something pointer device / mouse related like ptrMain? Introducing two-word modifiers doesn't seem like a good idea though because of all the case related stuff.
  2. What should the main signifiers be?

Previous names left, right, middle of course are kept but deprecated with warnings.

@dsbert
Copy link

dsbert commented Dec 11, 2017

If using primary and secondary, then tertiary would be the consistent name for the third, typically middle, button.

@st-sloth
Copy link
Contributor Author

The discussion kinda moved to the pull request, and Evan okayed the naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants