Exemple #1
0
 void renderForm_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     //if (hasFocus)
     {
         KeyEventPacked evt = new KeyEventPacked();
         evt.Args = e;
         evt.Pressed = false;
         evt.time = HighResolutionTimer.Ticks;
         compatNewKeyEvents.Add(evt);
     }
 }
Exemple #2
0
        void renderForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (hasFocus)
            {

                // Recieved a Keys.None press
                if (e.KeyCode == 0)
                    return;
                // Avoid repeat events
                if (!KeyboardRepeat && IsKeyDown(e.KeyCode))
                    return;
                KeyEventPacked evt = new KeyEventPacked();
                evt.Args = e;
                evt.Pressed = true;
                evt.time = HighResolutionTimer.Ticks;
                compatNewKeyEvents.Add(evt);
                e.Handled = true;
            }
        }