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

            window.key_args.Key      = TranslateKey(key.Scancode);
            window.key_args.ScanCode = (uint)key.Scancode;
            if (key_pressed)
            {
                window.KeyDown(window, window.key_args);
            }
            else
            {
                window.KeyUp(window, window.key_args);
            }
            //window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
        }
Exemplo n.º 2
0
 static void ProcessKeyEvent(Sdl2NativeWindow window, Event ev)
 {
     bool key_pressed = ev.Key.State == State.Pressed;
     var key = ev.Key.Keysym;
     window.key_args.Key = TranslateKey(key.Scancode);
     window.key_args.ScanCode = (uint)key.Scancode;
     window.key_args.Modifiers = window.input_driver.Keyboard[0].GetModifiers();
     if (key_pressed)
     {
         window.KeyDown(window, window.key_args);
     }
     else
     {
         window.KeyUp(window, window.key_args);
     }
     //window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
 }
Exemplo n.º 3
0
 static void ProcessKeyEvent(Sdl2NativeWindow window, Event ev)
 {
     bool key_pressed = ev.Key.State == State.Pressed;
     var key = ev.Key.Keysym;
     var args = new KeyboardKeyEventArgs() 
     { 
         Key = TranslateKey(key.Scancode),
         ScanCode = (uint)key.Scancode
     };
     if (key_pressed)
         window.KeyDown(window, args);
     else
         window.KeyUp(window, args);
     //window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
 }