Exemplo n.º 1
0
        private void OnKeyPress(object sender, KeyPressEventArgs e)
        {
            mKeyboardState.KeyChar   = e.KeyChar;
            mKeyboardState.IsPressed = true;

            OnKeyboard?.Invoke(this, mKeyboardState);

            mKeyboardState.IsPressed = false;
        }
Exemplo n.º 2
0
        private void OnKeyUp(object sender, KeyboardKeyEventArgs e)
        {
            mKeyboardState.Alt            = e.Alt;
            mKeyboardState.Control        = e.Control;
            mKeyboardState.Shift          = e.Shift;
            mKeyboardState.KeyDown[e.Key] = false;

            OnKeyboard?.Invoke(this, mKeyboardState);
        }
Exemplo n.º 3
0
        private void OnKeyDown(object sender, KeyboardKeyEventArgs e)
        {
            mKeyboardState.Alt            = e.Alt;
            mKeyboardState.Control        = e.Control;
            mKeyboardState.Shift          = e.Shift;
            mKeyboardState.KeyDown[e.Key] = true;

            Commands.ForEach(wCommand => wCommand.Check(mKeyboardState));

            OnKeyboard?.Invoke(this, mKeyboardState);
        }
Exemplo n.º 4
0
        private void OnUpdateFrame(object sender, FrameEventArgs e)
        {
            Dispatcher.ExecuteNextAction();

            mElapsedTime = mTimer.Elapsed.TotalSeconds;
            if (mElapsedTime < mWaitTime)
            {
                return;
            }

            OnMouse?.Invoke(this, mMouseState);
            OnKeyboard?.Invoke(this, mKeyboardState);
            GL.Enable(EnableCap.Texture2D);
            GL.Enable(EnableCap.ScissorTest);
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
            mRoot.Update();
        }