diff --git a/src/win32_window.c b/src/win32_window.c index 6c3a7cbb..bce14116 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -391,6 +391,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, { const int mods = getKeyMods(); + if (window->touchInput) + { + // Skip emulated button events when touch input is enabled + if ((GetMessageExtraInfo() & 0xffffff00) == 0xff515700) + break; + } + SetCapture(hWnd); if (uMsg == WM_LBUTTONDOWN) @@ -419,6 +426,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, { const int mods = getKeyMods(); + if (window->touchInput) + { + // Skip emulated button events when touch input is enabled + if ((GetMessageExtraInfo() & 0xffffff00) == 0xff515700) + break; + } + ReleaseCapture(); if (uMsg == WM_LBUTTONUP) @@ -473,7 +487,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, _glfwInputCursorEnter(window, GLFW_TRUE); } - return 0; + // NOTE: WM_MOUSEMOVE messages must be passed on to DefWindowProc + // for WM_TOUCH messages to be emitted + break; } case WM_MOUSELEAVE: