From 6d59934d816d321280f59e5be854246901ac3dfa Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 21 Apr 2018 11:34:34 +0200 Subject: [PATCH] Make so that the 0 key maps to preview of the 10th input. --- mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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)) { -- 2.39.2