From b768533890afc3700a2caed77956ca37121908cf Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Fri, 27 May 2022 10:23:20 -0600 Subject: [PATCH] Change global Klipper shortcuts to use the Meta key by default The current shortcuts could conceivably override app shortcuts, since they don't use the Meta key. The following changes are made: Automatic Action Popup Menu: Ctrl+Alt+X -> Meta+Ctrl+X Manually Invoke Action on Current Clipboard: Ctrl+Alt+R -> Meta+Ctrl+R These are safe to change in the code rather than adding a new one and keeping the old ones around for compatibility's sake because KGlobalAccel::setGlobalShortcut by default preserves old shortcuts when they are changed, and we aren't overriding that behavior here. So only new installs will get the new shortcuts and existing user installs will be untouched. --- klipper/klipper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/klipper/klipper.cpp b/klipper/klipper.cpp index 22e718f6d..28df33aa8 100644 --- a/klipper/klipper.cpp +++ b/klipper/klipper.cpp @@ -154,7 +154,7 @@ Klipper::Klipper(QObject *parent, const KSharedConfigPtr &config, KlipperMode mo m_toggleURLGrabAction = new KToggleAction(this); m_collection->addAction(QStringLiteral("clipboard_action"), m_toggleURLGrabAction); m_toggleURLGrabAction->setText(i18nc("@action:inmenu Toggle automatic action", "Automatic Action Popup Menu")); - KGlobalAccel::setGlobalShortcut(m_toggleURLGrabAction, QKeySequence(Qt::ALT | Qt::CTRL | Qt::Key_X)); + KGlobalAccel::setGlobalShortcut(m_toggleURLGrabAction, QKeySequence(Qt::META | Qt::CTRL | Qt::Key_X)); connect(m_toggleURLGrabAction, &QAction::toggled, this, &Klipper::setURLGrabberEnabled); /* @@ -195,7 +195,8 @@ Klipper::Klipper(QObject *parent, const KSharedConfigPtr &config, KlipperMode mo m_repeatAction = m_collection->addAction(QStringLiteral("repeat_action")); m_repeatAction->setText(i18nc("@action:inmenu", "Manually Invoke Action on Current Clipboard")); - KGlobalAccel::setGlobalShortcut(m_repeatAction, QKeySequence(Qt::ALT | Qt::CTRL | Qt::Key_R)); + KGlobalAccel::setGlobalShortcut(m_repeatAction, QKeySequence(Qt::META | Qt::CTRL | Qt::Key_R)); + connect(m_repeatAction, &QAction::triggered, this, &Klipper::slotRepeatAction); // add an edit-possibility