Game Development Community

Right button mouselook woes.

by J. Donavan Stanley · in Torque Game Engine · 11/29/2002 (11:22 am) · 1 replies

I'm having issues with implmenting a feature that turns mouselook on when you hold down the right mouse button and the turns it back off when you lift it. I put the following code in GuiCanvas::processInputEvent

if( event->deviceType == MouseDeviceType  && (event->objType == SI_BUTTON) && (event->objInst == KEY_BUTTON1) && smRightButtonMouseLook)
   {
      // This is a right button event and we have right button mouselook on.
      if(event->action == SI_MAKE)
      {
         setCursorON(false);
         rootRightMouseDown( mLastEvent );
      }
      else
      {
         setCursorON(true);
         rootRightMouseUp( mLastEvent );
      }
      
      return true;
   }

And it works just fine with one problem. It only works of you start in mouselook mode (i.e. setCursorON(false) ). As long as you start without cursor to begin with the mouse cursor turns on and off like it shoul and you can mouselook with the right button down. If you toggle the cursor off with a script (for example tying 'm' to toggle the cursor) all that happens is the cursor appears and disappears but moving the mouse doesn't move the view.

For the life of me I can't find what's so special about turning off the cursor from a script that would stop this from working. Has anyone implemented a feature like this?

#1
02/23/2006 (7:36 pm)
I know this post is extemely old, but I am curious if you ever got this problem resolved as I am trying to do the same thing!