Cursor problems
by Isaac Dutton · in Torque Game Engine · 02/23/2006 (6:34 pm) · 1 replies
function ToggleCam(%val)
{
if(%val)
{
$mouseRightDown = true;
CursorOff();
}
else
{
$mouseRightDown = false;
CursorOn();
}
}I am using this code, what its suppose to do is when the user right clicks it turns off the cursor and sets the mouseRightDown var to true, when it is released it sets it to false and turns the cursor on.
This works as long as the curser is off (meening I start the mission with it off it works once) How ever when I hold the right button once and release it the cursor comes on and then it dosnt work anymore. I think this is because all the right click events are going to the curso... Is this true?
About the author
Torque Owner AllynMcelrath
I needed the mouse button to let go of the mouse look, but it seems that if you unlock the mouse from the look,
You can't get it back... It completely disconnects the mouse from that kind of control.
So you cant have a toggle on the mouse, as in Click right mouse button, you have a curser. Click it again (thinking it will toggle you back to mouse look,and the code would do that becouse its correct) and nothing happens because the mouse control has been completely severed so that click never registered.. Only way to get it back is to map that function : Give_me_it_back (lol); to a keyboard.
It's very odd.
Side note: not that i have looked yet, buyt i wanted a simmular functionaility like when using the editor open (F11), you have your mouse free, but you need to rightclick and drag to change your view (mouselook), mabye our answer is in there.