imgui: Fix char input handling
This commit is contained in:
parent
cb8677b310
commit
478032ad28
2 changed files with 10 additions and 7 deletions
|
@ -5231,8 +5231,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||
#if ENABLE_IMGUI
|
||||
auto imgui = wxGetApp().imgui();
|
||||
if (imgui->update_key_data(evt)) {
|
||||
return;
|
||||
render();
|
||||
return;
|
||||
}
|
||||
#endif // ENABLE_IMGUI
|
||||
|
||||
|
|
|
@ -124,6 +124,9 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt)
|
|||
if (key != 0) {
|
||||
io.AddInputCharacter(key);
|
||||
}
|
||||
|
||||
new_frame();
|
||||
return want_keyboard() || want_text_input();
|
||||
} else {
|
||||
// Key up/down event
|
||||
int key = evt.GetKeyCode();
|
||||
|
@ -134,7 +137,6 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt)
|
|||
io.KeyCtrl = evt.ControlDown();
|
||||
io.KeyAlt = evt.AltDown();
|
||||
io.KeySuper = evt.MetaDown();
|
||||
}
|
||||
|
||||
// XXX: Unfortunatelly this seems broken due to some interference with wxWidgets,
|
||||
// we have to return true always (perform re-render).
|
||||
|
@ -142,6 +144,7 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt)
|
|||
// return want_keyboard() || want_text_input();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void ImGuiWrapper::new_frame()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue