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

Allow the flipping of the primary mouse button #2258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

geoff-harper
Copy link

@geoff-harper geoff-harper commented Dec 12, 2022

Hey I've finally had some time to go through and give this a swing. I decided to treat it the same as the click threshold values on the Mousetracker class since that made the most sense to me. Let me know if there are any convention things you'd like me to change.

There's the question of what to do with the context menu. Currently when you flip nothing is done about it so it opens after every pan. I wasn't sure if this is something we're concerned with or if it should be resolved in userland

As an aside, I went down a bit of a rabbit hole with isPrimary and getIsPrimary to eventually discover they don't really do anything. I've left them alone since there's a good chance I'm misinterpreting what they're for.

@iangilman
Copy link
Member

Thank you for getting this rolling! For reference, this is where this feature was discussed:

#2224

I'm still feeling like we would be better off adding a panWithSecondaryButton flag, as I think that future-proofs the API better. I'm particularly concerned about flipping the meaning of primary and secondary at the MouseTracker level, as that seems like it could lead to all sorts of confusion. I think the primary and secondary buttons should always be solid, and it's what they do that should be customizable.

Does that make sense?

@geoff-harper
Copy link
Author

geoff-harper commented Dec 15, 2022

Yeah I get that. Amusingly once I pulled the fork into my own project I realized all my canvas-clicks were now on right button too and I hated it. I can try to change it to flipping pan only.

To follow up, part of my issue personally is that canvas-drag isn't fired by the secondary button. Would changing this or adding a canvas-nonprimary-drag be appropriate? Unfortunately I can't just use the pan event since I specifically need pans that were triggered by user interaction, and not pans that were triggered programatically by myself

@iangilman
Copy link
Member

Good point! Yes, please add a canvas-nonprimary-drag; that seems like the right solution to me.

@iangilman
Copy link
Member

@geoff-harper Happy new year! Are you still interested in working on this patch?

@geoff-harper
Copy link
Author

Hey apologies I've been away. Yes I'd like to get this working but I haven't had the time lately and I'll be fairly busy through January. If someone else wanted to take it from here that would be fine since I don't want to hold up a release or anything, but I will come back and finish it otherwise

@iangilman
Copy link
Member

@geoff-harper Okay, great to know! We'll see if anyone else picks it up. Otherwise, see you in February :)

@msalsbery msalsbery self-assigned this Jul 31, 2023
@msalsbery
Copy link
Member

@geoff-harper @iangilman

I'm looking into taking this - see comment here

@msalsbery msalsbery linked an issue Aug 1, 2023 that may be closed by this pull request
@msalsbery
Copy link
Member

@geoff-harper I'll take this on if you're cool with that. If so, can I just take over your branch or should I make a new one?

cc @iangilman

@geoff-harper
Copy link
Author

Sure @msalsbery, sorry I got caught up in other things and I'm currently away for a month or so. Let me know what you need

@msalsbery
Copy link
Member

Sure @msalsbery, sorry I got caught up in other things and I'm currently away for a month or so. Let me know what you need

Cool, thank you - no problem. I'll work from your pr/2258 branch (I think...I'll post here if I start from a fresh branch)

The handling of alternate buttons by MouseTracker hasn't really changed since way back pre-v2 so I need to go through and bring it up-to-date with the W3C Pointer Events model so it's a bit more involved than just using the existing events ;)

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

Successfully merging this pull request may close these issues.

How to use the right mouse drag
3 participants