[Question] onClick for right mouse buttons clics? #2093
Replies: 3 comments
-
ok I can get it working with onPointerDown ;) |
Beta Was this translation helpful? Give feedback.
-
mmm it's not great as I can't distinguish a right click and a drag of the scene. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
the event for right click on the web is called "onContextMenu" and imo it should work. we have an example for that in the repo as well https://github.com/pmndrs/react-three-fiber/blob/master/example/src/demos/ContextMenuOverride.tsx you can even call ev.nativeEvent.preventDefault() to prevent the default browser behaviour. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It looks onClick doesn't forward right clicks. Any way to use also right clicks?
Beta Was this translation helpful? Give feedback.
All reactions