mirror of
https://github.com/monero-project/monero-gui
synced 2024-12-31 22:26:23 +01:00
shortcuts fix
This commit is contained in:
parent
2eddebe1c2
commit
4cbd5f57be
12
filter.cpp
12
filter.cpp
@ -21,6 +21,10 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
|
|||||||
QString sks;
|
QString sks;
|
||||||
if(ke->key() == Qt::Key_Control) {
|
if(ke->key() == Qt::Key_Control) {
|
||||||
sks = "Ctrl";
|
sks = "Ctrl";
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
} else if(ke->key() == Qt::Key_Meta) {
|
||||||
|
sks = "Ctrl";
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
QKeySequence ks(ke->modifiers() + ke->key());
|
QKeySequence ks(ke->modifiers() + ke->key());
|
||||||
sks = ks.toString();
|
sks = ks.toString();
|
||||||
@ -28,6 +32,8 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
|
|||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab"))
|
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab"))
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
sks.replace("Meta", "Ctrl");
|
||||||
#endif
|
#endif
|
||||||
emit sequencePressed(QVariant::fromValue<QObject*>(obj), sks);
|
emit sequencePressed(QVariant::fromValue<QObject*>(obj), sks);
|
||||||
} break;
|
} break;
|
||||||
@ -39,6 +45,10 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
|
|||||||
QString sks;
|
QString sks;
|
||||||
if(ke->key() == Qt::Key_Control) {
|
if(ke->key() == Qt::Key_Control) {
|
||||||
sks = "Ctrl";
|
sks = "Ctrl";
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
} else if(ke->key() == Qt::Key_Meta) {
|
||||||
|
sks = "Ctrl";
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
QKeySequence ks(ke->modifiers() + ke->key());
|
QKeySequence ks(ke->modifiers() + ke->key());
|
||||||
sks = ks.toString();
|
sks = ks.toString();
|
||||||
@ -46,6 +56,8 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) {
|
|||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab"))
|
if(sks.contains("Alt+Tab") || sks.contains("Alt+Shift+Backtab"))
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
sks.replace("Meta", "Ctrl");
|
||||||
#endif
|
#endif
|
||||||
emit sequenceReleased(QVariant::fromValue<QObject*>(obj), sks);
|
emit sequenceReleased(QVariant::fromValue<QObject*>(obj), sks);
|
||||||
} break;
|
} break;
|
||||||
|
Loading…
Reference in New Issue
Block a user