コード例 #1
0
 protected virtual void OnKeyUp(Alt.GUI.KeyEventArgs e)
 {
     if (Child != null)
     {
         Child.InjectKeyUp(e);
     }
 }
コード例 #2
0
        protected void RaiseKeyUp(Alt.GUI.KeyEventArgs e)
        {
            OnKeyUp(e);

            if (KeyUp != null)
            {
                KeyUp(this, e);
            }
        }
コード例 #3
0
        protected void RaiseKeyDown(Alt.GUI.KeyEventArgs e)
        {
            OnKeyDown(e);

            if (KeyDown != null)
            {
                KeyDown(this, e);
            }
        }
コード例 #4
0
    protected void Box2D_onKeyDown(Alt.GUI.KeyEventArgs e)
    {
        if (m_Test == null)
        {
            return;
        }

        m_Test.InjectKeyDown(e);
    }
コード例 #5
0
    protected void FarseerPhysics_onKeyUp(Alt.GUI.KeyEventArgs e)
    {
        if (m_Test == null)
        {
            return;
        }

        m_Test.InjectKeyUp(e);
    }
コード例 #6
0
    protected void FarseerPhysics_onKeyDown(Alt.GUI.KeyEventArgs e)
    {
        if (m_Test == null)
        {
            return;
        }

        // Press 'z' to zoom out.
        if (e.KeyCode == Alt.GUI.Keys.Z)
        {
            viewZoom = System.Math.Min(1.1 * viewZoom, 20.0);
        }
        // Press 'x' to zoom in.
        else if (e.KeyCode == Alt.GUI.Keys.X)
        {
            viewZoom = System.Math.Max(0.9 * viewZoom, 0.02);
        }
        // Press home to reset the view.
        else if (e.KeyCode == Alt.GUI.Keys.Home)
        {
            ResetView();
        }
        // Press left to pan left.
        else if (e.KeyCode == Alt.GUI.Keys.Left)
        {
            m_Test.m_OffsetX -= 0.5;
        }
        // Press right to pan right.
        else if (e.KeyCode == Alt.GUI.Keys.Right)
        {
            m_Test.m_OffsetX += 0.5;
        }
        // Press down to pan down.
        else if (e.KeyCode == Alt.GUI.Keys.Down)
        {
            m_Test.m_OffsetY += 0.5;
        }
        // Press up to pan up.
        else if (e.KeyCode == Alt.GUI.Keys.Up)
        {
            m_Test.m_OffsetY -= 0.5;
        }

        else
        {
            m_Test.InjectKeyDown(e);
        }
    }
コード例 #7
0
            protected override void OnKeyDown(Alt.GUI.KeyEventArgs e)
            {
                base.OnKeyDown(e);


                // Press 'z' to zoom out.
                if (e.KeyCode == Alt.GUI.Keys.Z)
                {
                    viewZoom = Math.Min(1.1 * viewZoom, 20.0);
                }
                // Press 'x' to zoom in.
                else if (e.KeyCode == Alt.GUI.Keys.X)
                {
                    viewZoom = Math.Max(0.9 * viewZoom, 0.02);
                }
                // Press 'r' to reset.
                else if (e.KeyCode == Alt.GUI.Keys.R)
                {
                    Restart();
                }
                // Press space to launch a bomb.
                else if (e.KeyCode == Alt.GUI.Keys.Space ||
                         e.KeyCode == Alt.GUI.Keys.B)
                {
                    LaunchBomb();
                }
                else if (e.KeyCode == Alt.GUI.Keys.P)
                // || newGamePad.IsButtonDown(Buttons.Start) && oldGamePad.IsButtonUp(Buttons.Start))
                {
                    Pause();
                }
                // Press left to pan left.
                else if (e.KeyCode == Alt.GUI.Keys.Left)
                {
                    m_OffsetX -= 10;
                }
                // Press right to pan right.
                else if (e.KeyCode == Alt.GUI.Keys.Right)
                {
                    m_OffsetX += 10;
                }
                // Press down to pan down.
                else if (e.KeyCode == Alt.GUI.Keys.Down)
                {
                    m_OffsetY += 10;
                }
                // Press up to pan up.
                else if (e.KeyCode == Alt.GUI.Keys.Up)
                {
                    m_OffsetY -= 10;
                }
                // Press home to reset the view.
                else if (e.KeyCode == Alt.GUI.Keys.Home)
                {
                    viewZoom  = 1.0;
                    m_OffsetX = 0;
                    m_OffsetY = 0;
                }
                else
                {
                    m_onBox2DKeyDown.Invoke(e);
                }
            }
コード例 #8
0
    protected void QuickFont_onKeyDown(Alt.GUI.KeyEventArgs e)
    {
        switch (e.KeyCode)
        {
        case Alt.GUI.Keys.Space:
        case Alt.GUI.Keys.Right:
            currentDemoPage++;
            break;

        case Alt.GUI.Keys.Backspace:
        case Alt.GUI.Keys.Left:
            currentDemoPage--;
            break;

        case Alt.GUI.Keys.Enter:
        {
            if (currentDemoPage == 4)
            {
                boundsAnimationCnt = 0f;
            }
        }
        break;

        case Alt.GUI.Keys.Up:
        {
            if (currentDemoPage == 4)
            {
                if (cycleAlignment == QFontAlignment.Justify)
                {
                    cycleAlignment = QFontAlignment.Left;
                }
                else
                {
                    cycleAlignment++;
                }
            }
        }
        break;

        case Alt.GUI.Keys.Down:
        {
            if (currentDemoPage == 4)
            {
                if (cycleAlignment == QFontAlignment.Left)
                {
                    cycleAlignment = QFontAlignment.Justify;
                }
                else
                {
                    cycleAlignment--;
                }
            }
        }
        break;

        case Alt.GUI.Keys.F9:

            break;
        }

        if (currentDemoPage > lastPage)
        {
            currentDemoPage = lastPage;
        }

        if (currentDemoPage < 1)
        {
            currentDemoPage = 1;
        }
    }