[effects/presentwindows] Trigger using LaunchA button

On MacBooks the "Exposé" button is on XF86LaunchA. Let's use it
for activating Present Windows (ALL) as an alternative shortcut.
For non-macbook users this doesn't hurt, for MacBook users it's a
nice touch to have the key working as indicated by the pictogram.

Yes, it's realy Key_LaunchC:
"On X11 this key is mapped to XF86XK_LaunchA key for legacy reasons."

REVIEW: 118721
This commit is contained in:
Martin Gräßlin 2014-06-20 09:26:28 +02:00
parent 8aa8617ed4
commit 634de251c3
2 changed files with 4 additions and 4 deletions

View file

@ -76,8 +76,8 @@ PresentWindowsEffect::PresentWindowsEffect()
QAction* exposeAllAction = new QAction(this);
exposeAllAction->setObjectName(QStringLiteral("ExposeAll"));
exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)"));
KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction);
effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction);
connect(exposeAllAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops()));

View file

@ -64,8 +64,8 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV
QAction* a = m_actionCollection->addAction(QStringLiteral("ExposeAll"));
a->setText(i18n("Toggle Present Windows (All desktops)"));
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC);
QAction* b = m_actionCollection->addAction(QStringLiteral("Expose"));
b->setText(i18n("Toggle Present Windows (Current desktop)"));