mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 07:34:35 +00:00
Win32: Fix capture logic ignoring last mouse button
This commit is contained in:
parent
2e9aff759e
commit
2fa90ae19f
@ -628,24 +628,24 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
else
|
else
|
||||||
action = GLFW_RELEASE;
|
action = GLFW_RELEASE;
|
||||||
|
|
||||||
for (i = 0; i < GLFW_MOUSE_BUTTON_LAST; i++)
|
for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++)
|
||||||
{
|
{
|
||||||
if (window->mouseButtons[i] == GLFW_PRESS)
|
if (window->mouseButtons[i] == GLFW_PRESS)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == GLFW_MOUSE_BUTTON_LAST)
|
if (i > GLFW_MOUSE_BUTTON_LAST)
|
||||||
SetCapture(hWnd);
|
SetCapture(hWnd);
|
||||||
|
|
||||||
_glfwInputMouseClick(window, button, action, getKeyMods());
|
_glfwInputMouseClick(window, button, action, getKeyMods());
|
||||||
|
|
||||||
for (i = 0; i < GLFW_MOUSE_BUTTON_LAST; i++)
|
for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++)
|
||||||
{
|
{
|
||||||
if (window->mouseButtons[i] == GLFW_PRESS)
|
if (window->mouseButtons[i] == GLFW_PRESS)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == GLFW_MOUSE_BUTTON_LAST)
|
if (i > GLFW_MOUSE_BUTTON_LAST)
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
|
|
||||||
if (uMsg == WM_XBUTTONDOWN || uMsg == WM_XBUTTONUP)
|
if (uMsg == WM_XBUTTONDOWN || uMsg == WM_XBUTTONUP)
|
||||||
|
Loading…
Reference in New Issue
Block a user