Exemplo n.º 1
0
        private static void ProcessKeyEvent(Sdl2NativeWindow window, Event ev)
        {
            bool key_pressed = ev.Key.State == State.Pressed;
            Key  key         = TranslateKey(ev.Key.Keysym.Scancode);

            if (key_pressed)
            {
                window.OnKeyDown(key, ev.Key.Repeat > 0);
            }
            else
            {
                window.OnKeyUp(key);
            }
        }
Exemplo n.º 2
0
 static void ProcessKeyEvent(Sdl2NativeWindow window, Event ev)
 {
     bool key_pressed = ev.Key.State == State.Pressed;
     Key key = TranslateKey(ev.Key.Keysym.Scancode);
     if (key_pressed)
     {
         window.OnKeyDown(key, ev.Key.Repeat > 0);
     }
     else
     {
         window.OnKeyUp(key);
     }
 }