Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1899,6 +1899,28 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1898 unmodified lines | ||
| 1899 | 1899 | } |
| 1900 | 1900 | break; |
| 1901 | 1901 | |
| 1902 | + case Qt::Key_1: | |
| 1903 | + case Qt::Key_2: | |
| 1904 | + case Qt::Key_3: | |
| 1905 | + case Qt::Key_4: | |
| 1906 | + case Qt::Key_5: | |
| 1907 | + case Qt::Key_6: | |
| 1908 | + case Qt::Key_7: | |
| 1909 | + if (isMeta || isOption) { | |
| 1910 | + unsigned int index = static_cast<unsigned int>(event->key() - Qt::Key_1); | |
| 1911 | + auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); | |
| 1912 | + if (index <= displayPlugins.size()) { | |
| 1913 | + auto targetPlugin = displayPlugins.at(index); | |
| 1914 | + QString targetName = targetPlugin->getName(); | |
| 1915 | + auto menu = Menu::getInstance(); | |
| 1916 | + QAction* action = menu->getActionForOption(targetName); | |
| 1917 | + if (action && !action->isChecked()) { | |
| 1918 | + action->trigger(); | |
| 1919 | + } | |
| 1920 | + } | |
| 1921 | + } | |
| 1922 | + break; | |
| 1923 | + | |
| 1902 | 1924 | case Qt::Key_X: |
| 1903 | 1925 | if (isShifted && isMeta) { |
| 1904 | 1926 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |