Skip to content

Commit

Permalink
IO: fix SetKeyEventNativeData() not handling ImGuiKey_None the same w…
Browse files Browse the repository at this point in the history
…ay as AddKeyEvent(). (#4905, #4858)
  • Loading branch information
ocornut committed Jan 13, 2022
1 parent 0647ba3 commit e51a0a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,8 @@ void ImGuiIO::AddKeyEvent(ImGuiKey key, bool down)
// If you are writing a backend in 2022 or don't use IsKeyXXX() with native values that are not ImGuiKey values, you can avoid calling this.
void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index)
{
if (key == ImGuiKey_None)
return;
IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512
IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey(native_legacy_index)); // >= 0 && <= 511
IM_UNUSED(native_keycode); // Yet unused
Expand Down

0 comments on commit e51a0a8

Please sign in to comment.