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

"contextmenu" (right click) event is not implemented #595

Open
ChrisFloofyKitsune opened this issue Feb 12, 2024 · 3 comments
Open

"contextmenu" (right click) event is not implemented #595

ChrisFloofyKitsune opened this issue Feb 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ChrisFloofyKitsune
Copy link
Contributor

I would like to be able to use right click to interact with things- but the go to event for that is not implemented.

https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event

For now, I don't mind doing a workaround using mousedown/up

@mikke89 mikke89 added the enhancement New feature or request label Feb 13, 2024
@mikke89
Copy link
Owner

mikke89 commented Feb 13, 2024

Thanks for the suggestion. Certainly sounds like a feature that we could add, I'd happily take a pull request.

I guess the reason this hasn't been implemented yet, is the assumption that users control the input side already, so they could do their actions directly on the library when receiving a right click. I guess a built-in event could add some value with proper event handling and propagation, and playing better with data bindings and scripting. It would be nice to understand the use case a bit better, could you elaborate on that a bit?

@ChrisFloofyKitsune
Copy link
Contributor Author

ChrisFloofyKitsune commented Feb 16, 2024

The main uses I see for this in what I'm working on (and in general) is to be able to right click usernames in a chat window or a player list- bringing up a small menu for things like Ignore, Whisper, Add Friend, Report, etc

it's a lot more friendly than having a weird crtl/shift/alt+mouse button keybind or having to type in a /command into the chat to do the same.

@mikke89
Copy link
Owner

mikke89 commented Feb 19, 2024

Yeah, I fully see the need for a context menu. I'm just trying to understand which alternatives you have considered for opening them and if they have any limitations. In particular, the library already submits mousedown and mouseup events also during right-click. Do these alternatives work well for you? I guess the semantics of contextmenu is more appropriate, so that should be reason enough to implement this.

Alternatively, the client can always open menus as desired, after all, the client supplies the information to the library about right mouse button being clicked, so they can act on that independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants