Showing the changes to interface/src/Application.cpp (1 of 30 files). Show all
Unified · Split
| @@ -418,6 +418,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 417 unmodified lines | ||
| 418 | 418 | MIDIManager& midiManagerInstance = MIDIManager::getInstance(); |
| 419 | 419 | midiManagerInstance.openDefaultPort(); |
| 420 | 420 | #endif |
| 421 | + | |
| 422 | + this->installEventFilter(this); | |
| 421 | 423 | } |
| 422 | 424 | |
| 423 | 425 | Application::~Application() { |
| @@ -844,6 +846,19 @@ bool Application::event(QEvent* event) { · 420 unmodified lines | ||
| 844 | 846 | return QApplication::event(event); |
| 845 | 847 | } |
| 846 | 848 | |
| 849 | +bool Application::eventFilter(QObject* object, QEvent* event) { | |
| 850 | + | |
| 851 | + if (event->type() == QEvent::ShortcutOverride) { | |
| 852 | + // Filter out captured keys before they're used for shortcut actions. | |
| 853 | + if (_controllerScriptingInterface.isKeyCaptured(static_cast<QKeyEvent*>(event))) { | |
| 854 | + event->accept(); | |
| 855 | + return true; | |
| 856 | + } | |
| 857 | + } | |
| 858 | + | |
| 859 | + return false; | |
| 860 | +} | |
| 861 | + | |
| 847 | 862 | void Application::keyPressEvent(QKeyEvent* event) { |
| 848 | 863 | |
| 849 | 864 | _keysPressed.insert(event->key()); |
| @@ -1539,9 +1554,12 @@ void Application::setEnableVRMode(bool enableVRMode) { · 689 unmodified lines | ||
| 1539 | 1554 | OculusManager::disconnect(); |
| 1540 | 1555 | OculusManager::connect(); |
| 1541 | 1556 | } |
| 1557 | + int oculusMaxFPS = Menu::getInstance()->getOculusUIMaxFPS(); | |
| 1558 | + setRenderTargetFramerate(oculusMaxFPS); | |
| 1542 | 1559 | OculusManager::recalibrate(); |
| 1543 | 1560 | } else { |
| 1544 | 1561 | OculusManager::abandonCalibration(); |
| 1562 | + setRenderTargetFramerate(0); | |
| 1545 | 1563 | } |
| 1546 | 1564 | |
| 1547 | 1565 | resizeGL(_glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); |