lihis

GUI - left / right click possible?

Recommended Posts

Hello,

With C2D i've used action managers left pick trigger for drag / click stuff and right pick trigger to make context menus, is there a way to enable right click on Babylon GUI elements?

I can only find the pointer down / up events. <_<

Thanky hanky.

Share this post


Link to post
Share on other sites

Yes i suppose.

Action manager has:

BABYLON.ActionManager.OnPickTrigger:

BABYLON.ActionManager.OnLeftPickTrigger:

BABYLON.ActionManager.OnRightPickTrigger:

and i use the left and right pick triggers, not the first one that triggers on both.

Share this post


Link to post
Share on other sites

@lihis -

If you're going to use right mouse events to trigger 'something', your browser will pop up the default context menu for each specific browser; which makes right mouse events annoying at best. However, you can disable the browser's default context menu by returning "false" in the event handler when capturing the onContextMenu event.

Example:

<body oncontextmenu="return false;">

If this is something you're already aware of, great. However, it's good for others to know as most Devs don't use right mouse events due to the various browser's displaying the context menu by default.

DB

Share this post


Link to post
Share on other sites

Ah, yes, nice tips.

I had indeed already done something very similar as it was annoying having that pesky browser context menu popping up!

Thankfully it was a problem easily solved with the help of google and copy paste. :lol:

Probably used right click for that... :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.