dotnet/Silk.NET

ImGuiController throws a NotImplementedException when a key event with Silk.NET.Input.Key.Unknown is fired.

EbiseLutica opened this issue · 4 comments

Summary

In the Silk.NET app using ImGui, when I press the key which Silk.NET detects as Silk.NET.Input.Key.Unknown, app throws an unhandled NotImplementedException with below stacktrace:

Unhandled exception. System.NotImplementedException: The method or operation is not implemented.
   at Silk.NET.OpenGL.Extensions.ImGui.ImGuiController.TranslateInputKeyToImGuiKey(Key key)
   at Silk.NET.OpenGL.Extensions.ImGui.ImGuiController.OnKeyEvent(IKeyboard keyboard, Key keycode, Int32 scancode, Boolean down)
   at Silk.NET.OpenGL.Extensions.ImGui.ImGuiController.OnKeyDown(IKeyboard keyboard, Key keycode, Int32 scancode)
   at Silk.NET.Input.Glfw.GlfwKeyboard.<Subscribe>b__33_1(WindowHandle* _, Keys key, Int32 code, InputAction action, KeyModifiers mods)
   at Silk.NET.Input.Glfw.GlfwEvents.<.ctor>b__0_1(WindowHandle* a, Keys b, Int32 c, InputAction d, KeyModifiers e)
   at Silk.NET.Windowing.Internals.ViewImplementationBase.Silk.NET.Windowing.IView.DoEvents()
   at Silk.NET.Windowing.Internals.ViewImplementationBase.Run(Action onFrame)
   at Silk.NET.Windowing.Glfw.GlfwWindow.Run(Action onFrame)
   at Silk.NET.Windowing.WindowExtensions.Run(IView view)
   ...

Steps to reproduce

  • Platform: Desktop
  • Framework Version: .NET 8, Windows 11
  • API: OpenGL
  • API Version: OpenGL 3.3
  1. Run https://github.com/prometeapp/SilkNetImGuiInputErrorTest
  2. Press Unknown key

Comments

Some example of keys Silk.NET detects as Silk.NET.Input.Key.Unknown:

  • [¥] key on Japanese OADG 109A
  • [\] key on Japanese OADG 109A

If you know how to fix this issue, please submit a pull request instead!

I have the same problem, when I use any media key it throws.

@EbiseLutica did you find a workaround?

Edit: Using version 1.16 seem to work.

@Jemy191 No I don't currently.

Note

This is just informational.

I am having the same issue and I am the one who created issue #2407.

Below is the issue in my own project Velaptor: