Fix cursor disappearing on title bar
by Brandon Maness · 04/27/2005 (9:32 am) · 8 comments
Add these lines to the engine\platformWin32\winWindow.cc file at the begining of the WindowProc switch block:
Now throw the last line a little further down in the OurDispatchMessages code block. Find the switch statement then right after the case WM_MOUSEMOVE: throw in just the while statement. It should look like this.
Note: If you are wondering why you don't just set the ShowCursor to true or false without the while statement the answer is that the ShowCursor function is really a value and not a switch. When you set it to true or false it increases or decreases the value it has stored. When the value is below 0 it turns off the cursor. Above that and it turns the cursor on.
Thanks again to Michael Melson for posting the file, location, and commands for this fix.
B--
case WM_NCMOUSEMOVE:
{
while(ShowCursor(TRUE) < 0);
break;
}Now throw the last line a little further down in the OurDispatchMessages code block. Find the switch statement then right after the case WM_MOUSEMOVE: throw in just the while statement. It should look like this.
case WM_MOUSEMOVE:
while(ShowCursor(FALSE) >= 0); //Here is the one added line
if ( !windowLocked )
{
MouseMoveEvent event;Note: If you are wondering why you don't just set the ShowCursor to true or false without the while statement the answer is that the ShowCursor function is really a value and not a switch. When you set it to true or false it increases or decreases the value it has stored. When the value is below 0 it turns off the cursor. Above that and it turns the cursor on.
Thanks again to Michael Melson for posting the file, location, and commands for this fix.
B--
About the author
#3
04/30/2005 (7:11 pm)
Oh good, much better. :)
#4
05/05/2005 (1:37 pm)
Very cool, legends sports it!
#5
This all seems to work except for the case where your window has context-sensitive actions like minimize, close, etc. If you right-click on the application icon on the task bar, and move the mouse over the context-sensitive menu, the window belives it has regained focus and the mouse cursor goes invisible. Has anyone fixed this?
01/03/2006 (3:39 pm)
I noted this in another thread, but it's worth mentioning here:This all seems to work except for the case where your window has context-sensitive actions like minimize, close, etc. If you right-click on the application icon on the task bar, and move the mouse over the context-sensitive menu, the window belives it has regained focus and the mouse cursor goes invisible. Has anyone fixed this?
#6
01/31/2006 (3:09 pm)
anyone know the reason Torque uses its own cursor ?
#7
It would be a nice feature to be able to use the native cursor in windowed mode (via some $pref).
03/01/2006 (12:31 am)
@Orion - Because it needs one in fullscreen mode. It was just easier to keep using the cursor rendered with the graphics layer than to toggle the native cursor on and off. It would be a nice feature to be able to use the native cursor in windowed mode (via some $pref).
#8
i guess it perturbs me because the cursor update rate gets tied torque's framerate, which for heavy apps can sometimes drop fairly low.
also i thought windows provides a cursor in full-screen mode ?
i may certainly be wrong there, and have no idea for other OSs.
werd-up on having a $pref for using the native cursor.
we'll probably be looking into that; i'll post here if anything comes of it.
03/01/2006 (1:04 am)
@Tom - thanks for replying on this old comment.i guess it perturbs me because the cursor update rate gets tied torque's framerate, which for heavy apps can sometimes drop fairly low.
also i thought windows provides a cursor in full-screen mode ?
i may certainly be wrong there, and have no idea for other OSs.
werd-up on having a $pref for using the native cursor.
we'll probably be looking into that; i'll post here if anything comes of it.

Associate Kyle Carter