Showing the changes to interface/src/Application.cpp (1 of 30 files). Show all
Unified · Split
| @@ -414,6 +414,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 413 unmodified lines | ||
| 414 | 414 | MIDIManager& midiManagerInstance = MIDIManager::getInstance(); |
| 415 | 415 | midiManagerInstance.openDefaultPort(); |
| 416 | 416 | #endif |
| 417 | + | |
| 418 | + this->installEventFilter(this); | |
| 417 | 419 | } |
| 418 | 420 | |
| 419 | 421 | Application::~Application() { |
| @@ -836,6 +838,19 @@ bool Application::event(QEvent* event) { · 416 unmodified lines | ||
| 836 | 838 | return QApplication::event(event); |
| 837 | 839 | } |
| 838 | 840 | |
| 841 | +bool Application::eventFilter(QObject* object, QEvent* event) { | |
| 842 | + | |
| 843 | + if (event->type() == QEvent::ShortcutOverride) { | |
| 844 | + // Filter out captured keys before they're used for shortcut actions. | |
| 845 | + if (_controllerScriptingInterface.isKeyCaptured(static_cast<QKeyEvent*>(event))) { | |
| 846 | + event->accept(); | |
| 847 | + return true; | |
| 848 | + } | |
| 849 | + } | |
| 850 | + | |
| 851 | + return false; | |
| 852 | +} | |
| 853 | + | |
| 839 | 854 | void Application::keyPressEvent(QKeyEvent* event) { |
| 840 | 855 | |
| 841 | 856 | _keysPressed.insert(event->key()); |
| @@ -1494,9 +1509,12 @@ void Application::setEnableVRMode(bool enableVRMode) { · 652 unmodified lines | ||
| 1494 | 1509 | OculusManager::disconnect(); |
| 1495 | 1510 | OculusManager::connect(); |
| 1496 | 1511 | } |
| 1512 | + int oculusMaxFPS = Menu::getInstance()->getOculusUIMaxFPS(); | |
| 1513 | + setRenderTargetFramerate(oculusMaxFPS); | |
| 1497 | 1514 | OculusManager::recalibrate(); |
| 1498 | 1515 | } else { |
| 1499 | 1516 | OculusManager::abandonCalibration(); |
| 1517 | + setRenderTargetFramerate(0); | |
| 1500 | 1518 | } |
| 1501 | 1519 | |
| 1502 | 1520 | resizeGL(_glWidget->getDeviceWidth(), _glWidget->getDeviceHeight()); |