From b8af8833e856e9aa45612992b8ad238cba721e2c Mon Sep 17 00:00:00 2001 From: Tweety-lab <108560864+Tweety-lab@users.noreply.github.com> Date: Mon, 26 May 2025 23:44:33 +1000 Subject: [PATCH 1/2] start of ImGui unknown key mapping fix. From 256cecbff8f2d11f2e37e0e8c6ab3eb0d4c142eb Mon Sep 17 00:00:00 2001 From: Tweety-lab <108560864+Tweety-lab@users.noreply.github.com> Date: Tue, 27 May 2025 00:03:09 +1000 Subject: [PATCH 2/2] Gracefully map invalid `Input.Key` to `ImGuiKey.None`. --- .../Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs b/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs index 6eafd99393..18f76a1e76 100644 --- a/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs +++ b/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs @@ -287,7 +287,6 @@ internal void PressChar(char keyChar) /// /// The Silk.NET.Input.Key to translate. /// The corresponding ImGuiKey. - /// When the key has not been implemented yet. private static ImGuiKey TranslateInputKeyToImGuiKey(Key key) { return key switch @@ -409,7 +408,7 @@ private static ImGuiKey TranslateInputKeyToImGuiKey(Key key) Key.F22 => ImGuiKey.F22, Key.F23 => ImGuiKey.F23, Key.F24 => ImGuiKey.F24, - _ => throw new NotImplementedException(), + _ => ImGuiKey.None, // Key isn't implemented }; }