diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -595,6 +595,7 @@ for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) { QAction *tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type)); + tab_action->setShortcut(rpcConsole->tabShortcut(tab_type)); connect(tab_action, &QAction::triggered, [this, tab_type] { rpcConsole->setTabFocus(tab_type); showDebugWindow(); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -73,6 +73,7 @@ } QString tabTitle(TabTypes tab_type) const; + QKeySequence tabShortcut(TabTypes tab_type) const; protected: virtual bool eventFilter(QObject *obj, QEvent *event) override; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1466,6 +1466,21 @@ return ui->tabWidget->tabText(tab_type); } +QKeySequence RPCConsole::tabShortcut(TabTypes tab_type) const { + switch (tab_type) { + case TAB_INFO: + return QKeySequence(Qt::CTRL + Qt::Key_I); + case TAB_CONSOLE: + return QKeySequence(Qt::CTRL + Qt::Key_T); + case TAB_GRAPH: + return QKeySequence(Qt::CTRL + Qt::Key_N); + case TAB_PEERS: + return QKeySequence(Qt::CTRL + Qt::Key_P); + default: + return QKeySequence(); + } +} + void RPCConsole::updateAlerts(const QString &warnings) { this->ui->label_alerts->setVisible(!warnings.isEmpty()); this->ui->label_alerts->setText(warnings);