Skip to content

Commit

Permalink
Keyboard lock can be skipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
anirul committed Mar 18, 2024
1 parent d077b55 commit 8222558
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/frame/opengl/gui/sdl_opengl_draw_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ bool SDL2OpenGLDrawGui::Update(DeviceInterface& device, double dt)
}
}
// Check if you should enable default window keyboard and mouse.
if (ImGui::IsWindowHovered() &&
is_default_output &&
!is_keyboard_passed_locked_)
if (ImGui::IsWindowHovered() && is_default_output )
{
is_keyboard_passed_ = true;
}
Expand Down Expand Up @@ -288,7 +286,9 @@ bool SDL2OpenGLDrawGui::PollEvent(void* event)
if (is_keyboard_passed_)
return false;
auto& io = ImGui::GetIO();
return io.WantCaptureMouse || io.WantCaptureKeyboard;
return (is_keyboard_passed_locked_)
? io.WantCaptureMouse || io.WantCaptureKeyboard
: false;
}

frame::gui::GuiWindowInterface& SDL2OpenGLDrawGui::GetWindow(
Expand Down

0 comments on commit 8222558

Please sign in to comment.