vasturiano / force-graph

Force-directed graph rendered on HTML5 canvas
https://vasturiano.github.io/force-graph/example/directional-links-particles/
MIT License
1.54k stars 246 forks source link

Detecting right click when mouse is moving #346

Open Slechani opened 6 months ago

Slechani commented 6 months ago

Is your feature request related to a problem? Please describe. I have implemented contextual menus in my graph by using the onRightClick events, there are different menu options that are displayed based on what I click on. My problem is that my users are reporting that the contextual menus aren't working properly and I discovered that it happened because some of them were slightly moving their mouse when clicking.

The problem is that the onRightClickEvents won't trigger if i'm moving the mouse even very slightly so I don't think I have any way to fix this problem.

Describe the solution you'd like I would like a way to make the right click events fire even when the mouse is moving as of right now just slightly moving the mouse a few pixels will prevent them from triggering

Thank you for helping me

eunukasiko commented 2 months ago

Yeah! The click events should be similar to mousedown rather than click events.