Example #1
0
 /// <inheritdoc />
 public virtual void OnKeyTyped(KeyEvent e)
 {
 }
Example #2
0
 /// <inheritdoc />
 public virtual void OnKeyReleased(KeyEvent e)
 {
 }
Example #3
0
 /// <inheritdoc />
 public virtual void OnKeyPressed(KeyEvent e)
 {
 }
Example #4
0
        // Called when a key has been released (after being pressed)
        public override void OnKeyReleased(KeyEvent e)
        {
            switch (e.KeyCode)
            {
                case Keys.VK_UP:
                case Keys.VK_DOWN:
                    // Arrow up and down keys: move direction = stand still
                    moveDirection = 0;
                    moveAmount = 0;
                    break;

                case Keys.VK_RIGHT:
                case Keys.VK_LEFT:
                    // Arrow right and left keys: turn direction = stop turning
                    turnDirection = 0;
                    break;
            }
        }
Example #5
0
        // Called when a key has been pressed
        public override void OnKeyPressed(KeyEvent e)
        {
            switch (e.KeyCode)
            {
                case Keys.VK_UP:
                    // Arrow up key: move direction = forward (infinitely)
                    moveDirection = 1;
                    moveAmount = Double.PositiveInfinity;
                    break;

                case Keys.VK_DOWN:
                    // Arrow down key: move direction = backward (infinitely)
                    moveDirection = -1;
                    moveAmount = Double.PositiveInfinity;
                    break;

                case Keys.VK_RIGHT:
                    // Arrow right key: turn direction = right
                    turnDirection = 1;
                    break;

                case Keys.VK_LEFT:
                    // Arrow left key: turn direction = left
                    turnDirection = -1;
                    break;
            }
        }
Example #6
0
 public override void OnKeyPressed(KeyEvent e)
 {
     //currentBehaviorIndex++;
 }