[SDL] Cursor disappears when moved

Ilya Olevsky info at valengames.com
Mon Oct 16 14:46:30 PDT 2006


> Thanks for the advice.
> 
> I put this check in my main code loop, and when the program starts up now, the
> cursor is hidden.
> 
> However, if later something happens on the system that causes the cursor to
> become an hourglass (disk access, etc), it causes the cursor to reappear.  I
> would think this code would correctly re-hide the cursor, but it does not.  Any
> other ideas?

Hmm.. That's weird, but then again I've seen Win98/ME do stranger 
things. Try calling SDL_WM_GrabInput(SDL_GRAB_ON) after you init 
everything, if you don't do it already. If that doesn't help, try hiding 
the cursor when the app gains mouse focus (on SDL_APPMOUSEFOCUS instead 
of SDL_APPINPUTFOCUS) or just check against SDL_APPACTIVE when you get 
an SDL_ACTIVEEVENT. That's pretty much all I can think of other than 
checking every frame if the mouse is visible.

Ilya





More information about the SDL mailing list