I'm using ImGui v1.84, I wanted to disable any sort of keyboard or mouse input while my ImGui window is open. How can I do this? (I'm fairly new to ImGui, & using Kiero Hook Dx11)
I modified the WndProc function to handle input events but I don't think I did it correctly?
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (uMsg == WM_KEYDOWN && wParam == VK_INSERT) {
showImGuiWindow = !showImGuiWindow;
ImGui::GetIO().MouseDrawCursor = showImGuiWindow; // To Toggle Mouse Cursor
return true;
}
if (showImGuiWindow) {
if (ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam))
return true;
// Block all keyboard and mouse input events when ImGui window is open?
if (uMsg == WM_KEYDOWN || uMsg == WM_KEYUP || uMsg == WM_CHAR ||
uMsg == WM_MOUSEMOVE || uMsg == WM_LBUTTONDOWN || uMsg == WM_LBUTTONUP ||
uMsg == WM_RBUTTONDOWN || uMsg == WM_RBUTTONUP || uMsg == WM_MBUTTONDOWN ||
uMsg == WM_MBUTTONUP || uMsg == WM_MOUSEWHEEL || uMsg == WM_MOUSEHWHEEL) {
return true;
}
}
return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}