Game Development Community

Cursor or Mouse:-)

by Wolfgang Kurz · in Torque Game Engine · 11/04/2006 (12:37 am) · 1 replies

Hello everyone:-)

i have this in my code

new GameTSCtrl(PlayerInterface) {
   profile = "GuiContentProfile";  
   noCursor = "0"; 
};

which turns the cursor off no matter what i put for the "0"

i did bind some functionality to the mouse which works fine

but now if i remove this line

noCursor = "0";

i get a cursor but the mouse buttons dont respond anymore:-(

the wierd thing is the mousewheel and the mouse movement still works as the cursor is actually moving its just the buttons that wont work

do i have to change soemthing in my bind?

anyone able to tell me how to fix this please?

#1
11/04/2006 (5:56 am)
Well i found out how to react to the left mouse click and release

i added these:

function GuiRTSTSCtrl:::onMouseDown(%this, %isDragSelect, %obj, %x, %y, %z)
{
    echo("left clicked on");
   
}
function GuiRTSTSCtrl::onRightMouseDown(%this, %obj, %x, %y, %z)
{
   
   echo("right clicked on");
 
}
function GuiRTSTSCtrl:::onMouseUp(%this, %isDragSelect, %obj, %x, %y, %z)
{
    echo("Release");
   
}

but i cant find a function to catch if the right or center button of the mouse was released


i found this function in guiplayerview.cc but dont know how to access it from script

//------------------------------------------------------------------------------
void GuiPlayerView::onRightMouseUp( const GuiEvent &/*event*/ )
{
   mouseUnlock();
   mMouseState = None;
}

since this didnt work:
function GuiRTSTSCtrl:::onRightMouseUp(%this, %isDragSelect, %obj, %x, %y, %z)
{
    echo("Release");
   
}

anyone know this please?