Jump to content

[SOLVED] Right click callback from script?


photo

Recommended Posts

Hi!

I need to set a callback for widget that was created in script on right click. So

Gui gui = engine.getGui();
string texture = "icon.dds";
WidgetIcon icon = new WidgetIcon( gui, texture );
icon.setCallback( GUI_CLICKED, "OnIconClicked" );

 

This callback runs only when I perform left-click on this widget. How can I set callback for right click?

Link to comment

You can use PRESSED/RELEASED pair to handle any mouse button clicks.

RELEASED callback will be available in the upcoming SDK.

 

icon.setCallback( GUI_PRESSED, "OnIconClicked" );

 

This code doesn't reacts on RMB too(

Link to comment

Is there a way to get the callback from other buttons?

 

There are some mouse has more than 3 buttons, if user want a callback from these buttons, then how should we do this?

Link to comment
×
×
  • Create New...