mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Update to latest
This commit is contained in:
parent
0e3a19d011
commit
c32230a320
|
|
@ -117,7 +117,21 @@ void KeyboardMouseInput::Tick()
|
||||||
}
|
}
|
||||||
if (!m_hasInput)
|
if (!m_hasInput)
|
||||||
{
|
{
|
||||||
m_keyState[vk] = true;
|
for (int i = 0; i < MAX_MOUSE_BUTTONS; i++)
|
||||||
|
{
|
||||||
|
if (m_mouseButtonDown[i]) { m_hasInput = true; break; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd)
|
||||||
|
{
|
||||||
|
RECT rc;
|
||||||
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
POINT center;
|
||||||
|
center.x = (rc.right - rc.left) / 2;
|
||||||
|
center.y = (rc.bottom - rc.top) / 2;
|
||||||
|
ClientToScreen(g_hWnd, ¢er);
|
||||||
|
SetCursorPos(center.x, center.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,9 +157,12 @@ void KeyboardMouseInput::OnKeyUp(int vkCode)
|
||||||
|
|
||||||
void KeyboardMouseInput::OnMouseButtonDown(int button)
|
void KeyboardMouseInput::OnMouseButtonDown(int button)
|
||||||
{
|
{
|
||||||
if (button < 0 || button >= 3) return;
|
if (button >= 0 && button < MAX_MOUSE_BUTTONS)
|
||||||
|
{
|
||||||
m_mouseButtons[button] = down;
|
if (!m_mouseButtonDown[button])
|
||||||
|
m_mouseBtnPressedAccum[button] = true;
|
||||||
|
m_mouseButtonDown[button] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardMouseInput::OnMouseButtonUp(int button)
|
void KeyboardMouseInput::OnMouseButtonUp(int button)
|
||||||
|
|
@ -236,7 +253,7 @@ bool KeyboardMouseInput::IsMouseButtonReleased(int button) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardMouseInput::ConsumeMouseDelta(float &dx, float &dy)
|
void KeyboardMouseInput::ConsumeMouseDelta(float& dx, float& dy)
|
||||||
{
|
{
|
||||||
dx = (float)m_mouseDeltaAccumX;
|
dx = (float)m_mouseDeltaAccumX;
|
||||||
dy = (float)m_mouseDeltaAccumY;
|
dy = (float)m_mouseDeltaAccumY;
|
||||||
|
|
@ -364,4 +381,4 @@ float KeyboardMouseInput::GetLookY(float sensitivity) const
|
||||||
return (float)(-m_mouseDeltaY) * sensitivity;
|
return (float)(-m_mouseDeltaY) * sensitivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _WINDOWS64
|
#endif // _WINDOWS64
|
||||||
Loading…
Reference in a new issue