mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-25 09:06:35 +00:00
IO: fix SetKeyEventNativeData() not handling ImGuiKey_None the same way as AddKeyEvent(). (#4905, #4858)
This commit is contained in:
parent
0647ba3bad
commit
e51a0a80ca
@ -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.
|
// 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)
|
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(ImGui::IsNamedKey(key)); // >= 512
|
||||||
IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey(native_legacy_index)); // >= 0 && <= 511
|
IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey(native_legacy_index)); // >= 0 && <= 511
|
||||||
IM_UNUSED(native_keycode); // Yet unused
|
IM_UNUSED(native_keycode); // Yet unused
|
||||||
|
Loading…
Reference in New Issue
Block a user