Skip to content

Commit 1196bfd

Browse files
gaborpappandrewfb
authored andcommitted
Fix keyboard event propagation when ImGui window has focus
1 parent d97809d commit 1196bfd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cinder/CinderImGui.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ bool ImGui::Initialize( const ImGui::Options& options )
557557
auto context = ImGui::CreateContext();
558558

559559
ImGuiIO& io = ImGui::GetIO();
560-
if( options.isKeyboardEnabled() ) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
560+
if( options.isKeyboardEnabled() ) {
561+
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
562+
io.ConfigFlags |= ImGuiConfigFlags_NavNoCaptureKeyboard; // Don't capture keyboard when navigation is active
563+
}
561564
if( options.isGamepadEnabled() ) io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
562565
ci::app::WindowRef window = options.getWindow();
563566
io.DisplaySize = ci::vec2( window->toPixels( window->getSize() ) );

0 commit comments

Comments
 (0)