From: Steinar H. Gunderson Date: Sat, 21 Apr 2018 09:34:34 +0000 (+0200) Subject: Make so that the 0 key maps to preview of the 10th input. X-Git-Tag: 1.7.2~37 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6d59934d816d321280f59e5be854246901ac3dfa;p=nageru Make so that the 0 key maps to preview of the 10th input. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 077942e..9f61c36 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -321,8 +321,15 @@ void MainWindow::mixer_created(Mixer *mixer) connect(ui_display->display, &GLWidget::color_updated, this, &MainWindow::update_channel_color); // Hook up the keyboard key. - QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_1 + i), this); - connect(shortcut, &QShortcut::activated, bind(&MainWindow::channel_clicked, this, i)); + QShortcut *shortcut = nullptr; + if (i < 9) { + shortcut = new QShortcut(QKeySequence(Qt::Key_1 + i), this); + } else if (i == 9) { + shortcut = new QShortcut(QKeySequence(Qt::Key_0), this); + } + if (shortcut != nullptr) { + connect(shortcut, &QShortcut::activated, bind(&MainWindow::channel_clicked, this, i)); + } // Hook up the quick-cut key. if (i < strlen(qwerty)) {