Example #1
0
 public unsafe void Subscribe(GlfwEvents events)
 {
     _handle      = events.Handle;
     events.Char += _char = (_, c) => KeyChar?.Invoke(this, (char)c);
     events.Key  += _key = (_, key, code, action, mods) =>
                           (action switch
     {
         InputAction.Press => KeyDown,
         InputAction.Release => KeyUp,
         InputAction.Repeat => null,
         _ => null
     })?.Invoke(this, ConvertKey(key), code);
Example #2
0
 public static extern IntPtr SetKeyCallback(Window window, GlfwCallbacks.KeyCallback callback);