- Hide the cursor by overriding WM_SETCURSOR, as seen in the IDirect3DDEvice9::ShowCursor()
example. Do not modify the window class pointer. I still had an instance where I was left with an invisible pointer no matter where I moved it, so hopefully this takes care of that. (edit: it doesn't.) SVN r2496 (trunk)
This commit is contained in:
parent
d32d8b4f9f
commit
6000217889
3 changed files with 20 additions and 8 deletions
|
|
@ -134,7 +134,7 @@ static FMouse *(*MouseFactory[])() =
|
|||
|
||||
FMouse *Mouse;
|
||||
|
||||
HCURSOR TheArrowCursor;
|
||||
bool CursorState;
|
||||
|
||||
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
|
|
@ -181,11 +181,17 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|||
|
||||
static void SetCursorState(bool visible)
|
||||
{
|
||||
HCURSOR usingCursor = visible ? TheArrowCursor : NULL;
|
||||
SetClassLongPtr(Window, GCLP_HCURSOR, (LONG_PTR)usingCursor);
|
||||
CursorState = visible;
|
||||
if (GetForegroundWindow() == Window)
|
||||
{
|
||||
SetCursor(usingCursor);
|
||||
if (visible)
|
||||
{
|
||||
SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCursor(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue