Commit 12914fe9 authored by chili's avatar chili
Browse files

disabling of imgui mouse input

parent 2f5bddb5
......@@ -123,12 +123,14 @@ void Window::EnableCursor()
{
cursorEnabled = true;
ShowCursor();
EnableImGuiMouse();
}
void Window::DisableCursor()
{
cursorEnabled = false;
HideCursor();
DisableImGuiMouse();
}
std::optional<int> Window::ProcessMessages() noexcept
......@@ -172,6 +174,16 @@ void Window::ShowCursor()
while( ::ShowCursor( TRUE ) < 0 );
}
void Window::EnableImGuiMouse()
{
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
}
void Window::DisableImGuiMouse()
{
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouse;
}
LRESULT CALLBACK Window::HandleMsgSetup( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noexcept
{
// use create parameter passed in from CreateWindow() to store window class pointer at WinAPI side
......
......@@ -82,6 +82,8 @@ public:
private:
void HideCursor();
void ShowCursor();
void EnableImGuiMouse();
void DisableImGuiMouse();
static LRESULT CALLBACK HandleMsgSetup( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noexcept;
static LRESULT CALLBACK HandleMsgThunk( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noexcept;
LRESULT HandleMsg( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam ) noexcept;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment