在WM_MOUSEFIRST上找不到任何文档 [英] Can't find any documentation on WM_MOUSEFIRST
问题描述
我有我的自定义WndProc,它应该根据我的ImGui菜单是否打开来处理输入.
I have my custom WndProc which is supposed to handle input depending on if my ImGui menu is open.
if (Menu::isOpen) {
ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam);
if (msg == WM_LBUTTONDOWN
|| msg == WM_LBUTTONUP
|| msg == WM_LBUTTONDBLCLK
|| msg == WM_MBUTTONDOWN
|| msg == WM_MBUTTONUP
|| msg == WM_MBUTTONDBLCLK
|| msg == WM_RBUTTONDOWN
|| msg == WM_RBUTTONUP
|| msg == WM_RBUTTONDBLCLK
|| msg == WM_XBUTTONDOWN
|| msg == WM_XBUTTONUP
|| msg == WM_XBUTTONDBLCLK
|| msg == WM_MOUSEFIRST) return 0;
}
return CallWindowProc((WNDPROC)Get().m_ulOldWndProc, hWnd, msg, wParam, lParam);
我的目标是在打开ImGui的情况下,仅防止鼠标单击进入背景.我注意到,如果我不阻止WM_MOUSEFIRST进行,某些点击仍然偶尔会在应用程序中注册.我还注意到,当我确实阻止执行WM_MOUSEFIRST时,将鼠标悬停在应用程序中的内容上是行不通的,这是我想要的.我以为可以通过检查wParams或lParams中的内容来解决此问题,但是我找不到有关WM_MOUSEFIRST的任何文档
My goal is to prevent ONLY mouse clicks from going to the background if my ImGui is open. I noticed that if I don't prevent WM_MOUSEFIRST from going through, some clicks still occasionally register in the app. I've also noticed that when I do prevent WM_MOUSEFIRST from going through, hovering over stuff in the application doesn't work, which I would like to. I thought that I could fix the problem by checking for something in the wParams or lParams, but I can't find any documentation on those for WM_MOUSEFIRST
推荐答案
粉碎鼠标后,我发现只有在鼠标移动时点击才会注册.这是因为应用程序检查WM_MOUSEMOVE(与WM_MOUSEFIRST相同)是否设置了wParam MK_LBUTTON.我只是添加了. ||((msg == WM_MOUSEMOVE)&&(wParam!= 0))
After smashing my mouse I found out that the click only registers if the mouse is moving. It was because the application checked if WM_MOUSEMOVE (which is same as WM_MOUSEFIRST) had the wParam MK_LBUTTON set. I simply added. || ((msg == WM_MOUSEMOVE) && (wParam != 0))
这篇关于在WM_MOUSEFIRST上找不到任何文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!