From a55bb39f2044f3aa4545ead0cdad840d0898697c Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 27 Sep 2020 22:49:22 -0400 Subject: [PATCH] Fix SSH Add/Remove Key Shortcut on macOS * Fixes #5378 * Add Key to SSH Agent is Ctrl + H on all platforms * Remove Key from SSH Agent is Ctrl + Shift + H on all platforms --- src/gui/MainWindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index f5e0541b3..ef2a56aa7 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -258,8 +258,15 @@ MainWindow::MainWindow() m_ui->actionEntryAutoType->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_V); m_ui->actionEntryOpenUrl->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_U); m_ui->actionEntryCopyURL->setShortcut(Qt::CTRL + Qt::Key_U); - m_ui->actionEntryAddToAgent->setShortcut(Qt::CTRL + Qt::Key_H); - m_ui->actionEntryRemoveFromAgent->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_H); + + // Prevent conflicts with global Mac shortcuts (force Control on all platforms) +#ifdef Q_OS_MAC + auto modifier = Qt::META; +#else + auto modifier = Qt::CTRL; +#endif + m_ui->actionEntryAddToAgent->setShortcut(modifier + Qt::Key_H); + m_ui->actionEntryRemoveFromAgent->setShortcut(modifier + Qt::SHIFT + Qt::Key_H); #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) // Qt 5.10 introduced a new "feature" to hide shortcuts in context menus