Game Development Community

InputManager option - mouse right click ?

by Christian · in Torque 2D Beginner · 11/18/2013 (10:32 pm) · 2 replies

Is there a way to have InputManager recognize right mouse clicks?

InputManager's dump didn't reveal a way to add a right click, although
function InputManager::onTouchDown(%this, %touchId, %worldposition) leads me to believe the %touchId may be capable of more than the default value of 0 (assuming 0 means left click)?

The PickingToy didn't seem to have a value for any particular mouse button.

The 3rd option I considered was using the inputManager::Init_Controls(%this)
and adding in an action for the right mouse:
shipcontrols.bindCmd(mouse, "1", "echo_stuff();", "echo_stuff();");

Are any of these on the right path?

#1
11/19/2013 (3:55 am)
I'm a bit confused on where the InputManager class is coming from - I know there is one in the platform layer but scripting input callbacks is handled through the SceneWindow or whatever GuiControl is currently pushed to the top of the stack.

If you are trying to add right mouse clicks to SceneObjects - that currently requires source changes. See here:
www.garagegames.com/community/forums/viewthread/135213

The input guide on the wiki also covers input event callbacks.
#2
11/19/2013 (3:57 am)
Thanks Mike