Ejemplo n.º 1
0
        /// <summary>
        /// As a convenience, the sample framework inspects the incoming windows messages for
        /// keystroke messages and decodes the message parameters to pass relevant keyboard
        /// messages to the application.  The framework does not remove the underlying keystroke
        /// messages, which are still passed to the application's MsgProc callback.
        /// </summary>
        private void OnKeyEvent(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case System.Windows.Forms.Keys.F1:
                break;

            case System.Windows.Forms.Keys.Add:
                if (Framework.Instance.CurrentCamera == cameraPilot)
                {
                    cameraPilot.ZoomFactor *= 1.5f;
                }
                break;

            case System.Windows.Forms.Keys.Subtract:
                if (Framework.Instance.CurrentCamera == cameraPilot)
                {
                    cameraPilot.ZoomFactor /= 1.5f;
                }
                break;
            }
            if (modelControl != null)
            {
                modelControl.OnKeyEvent(sender, e);
            }
        }