Beispiel #1
0
        static bool OnKeyUp(KeyCode keyCode)
        {
            if (device == null)
            {
                return(false);
            }

            if (hasModalDialog())
            {
                return(false);
            }

            switch (keyCode)
            {
            case KeyCode.Esc:
                CameraSceneNode c = device.SceneManager.ActiveCamera;
                if (c != null)
                {
                    c.InputReceiverEnabled = !c.InputReceiverEnabled;
                }

                return(true);

            case KeyCode.F1:
                GUIElement e = device.GUIEnvironment.RootElement.GetElementFromID((int)guiID.PositionText);
                if (e != null)
                {
                    e.Visible = !e.Visible;
                }

                break;

            case KeyCode.KeyM:
                device.MinimizeWindow();
                break;

            case KeyCode.KeyL:
                useLight = !useLight;
                if (model != null)
                {
                    model.SetMaterialFlag(MaterialFlag.Lighting, useLight);
                    model.SetMaterialFlag(MaterialFlag.NormalizeNormals, useLight);
                }

                break;
            }

            return(false);
        }