Two cursors in Mac full screen
by Tetraweb · in Torque Game Builder · 02/17/2008 (1:53 pm) · 5 replies
Create a new project and empty level and play it on Mac. Open console and type:
toggleFullScreen();
to enter fulls screen mode. Move your cursor somewhere other than the center and type this in the console:
sceneWindow2D.setMousePosition("0 0");
You will see two cursors. The real one, you will find as soon as you move the mouse, is just where it was before you tried to set the position. Type "toggleFullScreen();" again and set the position to the center and it works as expected, the actual cursor is reset to the center.
This is seriously messing with some cursor control movement I am working on for a tutorial series. It may be related to this other bug:
www.garagegames.com/mg/forums/result.thread.php?qt=67835
since both deal with having two cursors on the screen at once.
Greg
toggleFullScreen();
to enter fulls screen mode. Move your cursor somewhere other than the center and type this in the console:
sceneWindow2D.setMousePosition("0 0");
You will see two cursors. The real one, you will find as soon as you move the mouse, is just where it was before you tried to set the position. Type "toggleFullScreen();" again and set the position to the center and it works as expected, the actual cursor is reset to the center.
This is seriously messing with some cursor control movement I am working on for a tutorial series. It may be related to this other bug:
www.garagegames.com/mg/forums/result.thread.php?qt=67835
since both deal with having two cursors on the screen at once.
Greg
#2
Greg
02/19/2008 (4:40 am)
I fixed the link. I was logged in to the IP when I posted this; I have been having the same problem that many others have had with the forum being occasionally unresponsive.Greg
#3
There are basically three problems:
1) There's no way to independently turn on/off the custom cursor and the hardware cursor.
2) Turning off the custom cursor kills any mouse tracking.
3) All these cursor functions and variables are confusingly named (I'm not touching that one).
In guiCanvas.cc, change GuiCanvas::setCursorON() to:
In GuiCanvas::processMouseMoveEvent(), remove the if( cursorON ) conditional:
And in guiCanvas.h, change the following line:
So, in script now, to show just the custom cursor:
Like I said, the functions are very confusingly named.
02/21/2008 (7:13 pm)
This is related to another issue I had. Likely neither of you has the source, but if GG wants a fix, here it is.There are basically three problems:
1) There's no way to independently turn on/off the custom cursor and the hardware cursor.
2) Turning off the custom cursor kills any mouse tracking.
3) All these cursor functions and variables are confusingly named (I'm not touching that one).
In guiCanvas.cc, change GuiCanvas::setCursorON() to:
void GuiCanvas::setCursorON(bool onOff)
{
cursorON = onOff;
// if(!cursorON)
// mMouseControl = NULL;
mShowCursor = onOff;
}mShowCursor needs to be set to so that the custom cursor is shown or hidden, and mMouseControl needs to be retained even when the cursor is hidden so I commented that out.In GuiCanvas::processMouseMoveEvent(), remove the if( cursorON ) conditional:
void GuiCanvas::processMouseMoveEvent(const MouseMoveEvent *event)
{
// if( cursorON )
...
//} don't forget the end brace
}In GuiCanvas::processInputEvent change the following line:else if(event->deviceType == MouseDeviceType && cursorON)to:
else if(event->deviceType == MouseDeviceType)The above two changes just make sure mouse tracking still works!
And in guiCanvas.h, change the following line:
// virtual void showCursor(bool state) { mShowCursor = state; Input::setCursorState(state); }to:virtual void showCursor(bool state) {Input::setCursorState(state)}Since showCursor() is supposed to hide the hardware cursor, we don't want it hiding the custom cursor too.So, in script now, to show just the custom cursor:
Canvas.hideCursor(); Canvas.cursorOn();And to show just the hardware cursor:
Canvas.showCursor(); Canvas.cursorOff();
Like I said, the functions are very confusingly named.
#4
02/21/2008 (10:13 pm)
Nice, I'll rebuild using your changes and report the results. Thanks Ken!
#5
I have a bit of suspicion the problem lies in consoleFunctions.cc. More specifically, in one of these two functions.
02/21/2008 (10:38 pm)
Just built using the changes, and so far very promising.Canvas.hideCursor(); Canvas.cursorOn();Works perfectly in fullscreen. Works great in Windowed mode as long as I remember to give back the hardware cursor in script when the user leaves the window.
Canvas.showCursor(); Canvas.cursorOff();I had mixed results with this setup however. It works fine when run from a script file, but when I type these commands into a projects console window, it likes to reset my settings back to the standard dual mousey action.
I have a bit of suspicion the problem lies in consoleFunctions.cc. More specifically, in one of these two functions.
ConsoleFunctionGroupBegin( InputManagement, "Functions that let you deal with input from scripts" );
ConsoleFunction( deactivateDirectInput, void, 1, 1, "Deactivate input. (ie, ungrab the mouse so the user can do other things." )
{
argc; argv;
if ( Input::isActive() )
Input::deactivate();
}
//--------------------------------------------------------------------------
ConsoleFunction( activateDirectInput, void, 1, 1, "Activate input. (ie, grab the mouse again so the user can play our game." )
{
argc; argv;
if ( !Input::isActive() )
Input::activate();
}
Torque Owner Christopher Andrade
And that's odd, when I try to follow your link, it says I must have purchased a Torque Game Builder Pro or Indie license. Clearly I have, otherwise I wouldn't be able to access this forum no?
Well, regardless I can confirm that there still are two mouse cursors while running fullscreen in OS X.