X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.cpp;h=9f61c36ebe1b5497afd7ff5524246b4f3830646f;hb=4a300e3cab7b1b1ef5a32e1f4a7ec319c48e95e5;hp=077942ec11afdaea8c6c2ec84d8b8291928f15cc;hpb=c3cbe8c3093e818311a133d0cb8141e5125b9b27;p=nageru 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)) {