Open acidicoala opened 3 years ago
Hello,
I was wondering if there are any plans to support such pointer event messages in the future? Or does it already exist and I've just missed it?
It's not supported yet. I don't have such device and wouldn't be able to test for it. Pull requests would be appreciated but I think they would need to be mindful of things discussed e.g. in #2334, #2372, #2729, #2650.
-Omar
Hello there. Some windows instead of sending typical mouse input messages that ImGui expects
Could you elaborate on "some windows" ? AFAIK the behavior is documented here: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enablemouseinpointer
EnableMouseInPointer = TRUE
,EnableMouseInPointer = FALSE
, aka pointer events are not emitting mouse events.Can you confirm your setup and if you are calling EnableMouseInPointer()
and what is the result of IsMouseInPointerEnabled()
?
If you have mouse-in-pointer enabled then I guess it means you are handling WM_POINTER events and you can convert them to mouse events.
This is wrong:
switch(uMsg)
{
case WM_POINTERDOWN:
uMsg = WM_LBUTTONDOWN;
break;
case WM_POINTERUP:
uMsg = WM_LBUTTONUP;
break;
case WM_POINTERWHEEL:
uMsg = WM_MOUSEWHEEL;
break;
case WM_POINTERUPDATE:
uMsg = WM_SETCURSOR;
break;
}
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
Because the meaning of wParam
and lParam
is different between WM_POINTER messages and Mouse equivalent, so this need so be remapped.
If there is a confirmation that you are using EnableMouseInPointer = TRUE;
I am curious why.
We could consider adding that support in imgui_impl_win32 but it seems like a edge case for something you would normally already be able to do if EnableMouseInPointer = TRUE
.
Config/Build Information
My Issue/Question:
Hello there. Some windows instead of sending typical mouse input messages that ImGui expects (MS docs reference), send pointer event messages (MS docs reference). Therefore mouse input does not get processed with
ImGui_ImplWin32_WndProcHandler
. On my end I am using a hacky fix in which I substitute pointer events with mouse input messages that ImGui expects. For example:I was wondering if there are any plans to support such pointer event messages in the future? Or does it already exist and I've just missed it?