示例#1
0
文件: Input.cs 项目: maesse/CubeHags
 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);
     }
 }
示例#2
0
文件: Input.cs 项目: maesse/CubeHags
        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;
            }
        }