コード例 #1
0
        partial void OnKeyDown(object sender, KeyEventArgs e)
        {
            int index = tabControl1.SelectedIndex;

            switch (e.KeyData)
            {
            case Keys.PageUp:
            case Keys.Left:
                index--;
                if (index == -1)
                {
                    index = tabControl1.TabPages.Count - 1;
                }
                SelectTab(tabControl1.TabPages[index]);
                break;

            case Keys.Next:
            case Keys.Right:
                index++;
                if (index == tabControl1.TabPages.Count)
                {
                    index = 0;
                }
                SelectTab(tabControl1.TabPages[index]);
                break;

            case Keys.F5:
            case Keys.Escape:
                UiForTab(_ui.ActiveTab).GetInspector().Animations.OnPlay(sender, e);
                break;

            case Keys.OemPeriod:
                UiForTab(_ui.ActiveTab).GetInspector().Animations.SetTime(0);
                break;

            case Keys.W:
                _forwardPressed = true;
                break;

            case Keys.A:
                _leftPressed = true;
                break;

            case Keys.S:
                _backPressed = true;
                break;

            case Keys.D:
                _rightPressed = true;
                break;

            case Keys.Up:
                _upPressed = true;
                break;

            case Keys.Down:
                _downPressed = true;
                break;

            case Keys.NumPad9:
                _fovyUpPressed = true;
                break;

            case Keys.NumPad3:
                _fovyDownPressed = true;
                break;

            case Keys.NumPad4:
            case Keys.NumPad5:
            case Keys.NumPad6:
                _shiftPressed = true;
                break;

            case Keys.R:
                // reset camera immediatelly
                UiState.ActiveTab.ResetActiveCameraController();
                break;

            case Keys.O:
                //reset offset
                OpenVRInterface.viewOffset = Matrix4.Identity;
                break;

            case Keys.Subtract:
                timeOffset = timeOffset + 5;;
                if (timeOffset >= mainTiming)
                {
                    timeOffset = 0;
                }
                break;

            case Keys.Add:
                timeOffset = timeOffset - 5;
                if (timeOffset < 0)
                {
                    timeOffset = mainTiming - 5;
                }
                break;

            case Keys.E:
                // switch backend
                if (_settings == null || _settings.IsDisposed)
                {
                    _settings = new SettingsDialog {
                        Main = this
                    }
                }
                ;
                _settings.ChangeRenderingBackend();
                break;

            case Keys.V:
                // reset NDI streams
                if (useIO)
                {
                    _renderer.FlushNDI();
                }
                break;

            case Keys.T:
                // skips one frame
                _renderer.skipFrames = 1;
                break;

            case Keys.B:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Background);
                }
                break;

            case Keys.F:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Foreground);
                }
                break;

            case Keys.X:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Others);
                }
                break;

            case Keys.C:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Camera);
                }
                break;

            case Keys.L:
                UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.All);
                break;

            case Keys.J:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.CameraCancelColor);
                }
                break;

            case Keys.M:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Composite);
                }
                break;

            case Keys.K:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.Keying);
                }
                break;

            case Keys.G:
                if (_renderer.renderIO)
                {
                    UiState.ActiveTab.ActiveCameraController.SetScenePartMode(ScenePartMode.GreenScreen);
                }
                break;

            case Keys.Enter:
                _renderer.activeCamera = 3 - _renderer.activeCamera;
                break;
            }
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: GraceDarkling/open3mod
 public void CloseSettingsDialog()
 {
     Debug.Assert(_settings != null);
     _settings.Close();
     _settings = null;
 }
コード例 #3
0
 public void CloseSettingsDialog()
 {
     Debug.Assert(_settings != null);
     _settings.Close();
     _settings = null;
 }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: GraceDarkling/open3mod
        private void OnShowSettings(object sender, EventArgs e)
        {
            if (_settings == null || _settings.IsDisposed)
            {
                _settings = new SettingsDialog {Main = this};
            }

            if(!_settings.Visible)
            {
                _settings.Show();
            }
        }