Generic scene right click

Sorry for yet another question.

I know we can determine right clicks on GUI elements through onPointerDownObservable’s pointer-info, but it doesn’t look like we can do the same for the scene in general. scene.onPointerDown seems to be only for left-clicks. What would my best bet be for detecting a right click by the user anywhere in the scene? Not sure if this changes anything, but the mouse has been captured. Haven’t had any luck with conventional javascript/DOM detection.

you can read it from the event object
Check here: https://www.babylonjs-playground.com/#7CBW04#29
line 113

1 Like

Thank-you so much! Only just started scouring the docs, didn’t know of the more generic onPointerObservable. Just what I needed.

2 Likes

Read what attribute off of the event object though? On a mac a single finger tap/click on the touch pad vs a two finger tap/click (which is how I mapped right click) seems to yield the same data. isPrimary is true and both events have the same pointerId.

1 Like