|
@@ -12,9 +12,6 @@
|
|
|
#include <QKeyEvent>
|
|
|
#include <QObject>
|
|
|
|
|
|
-#ifdef Q_OS_WIN
|
|
|
-static QStringList desktopWhiteListedKeys = { "Back"};
|
|
|
-#else
|
|
|
static QStringList desktopWhiteListedKeys = { "Media Play",
|
|
|
"Media Pause",
|
|
|
"Media Stop",
|
|
@@ -23,10 +20,15 @@ static QStringList desktopWhiteListedKeys = { "Media Play",
|
|
|
"Media Rewind",
|
|
|
"Media FastForward",
|
|
|
"Back"};
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
-static QStringList win32AppcommandBlackListedKeys = desktopWhiteListedKeys;
|
|
|
+static QStringList win32BlackListedKeys = { "Media Play",
|
|
|
+ "Media Pause",
|
|
|
+ "Media Stop",
|
|
|
+ "Media Next",
|
|
|
+ "Media Previous",
|
|
|
+ "Media Rewind",
|
|
|
+ "Media FastForward"};
|
|
|
|
|
|
|
|
|
static QString keyEventToKeyString(QKeyEvent *kevent)
|
|
@@ -84,6 +86,13 @@ bool EventFilter::eventFilter(QObject* watched, QEvent* event)
|
|
|
keystatus = InputBase::KeyUp;
|
|
|
|
|
|
QString seq = keyEventToKeyString(key);
|
|
|
+#ifdef Q_OS_WIN32
|
|
|
+ if (win32BlackListedKeys.contains(seq))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
if (desktopWhiteListedKeys.contains(seq))
|
|
|
{
|
|
|
InputKeyboard::Get().keyPress(seq, keystatus);
|
|
@@ -143,12 +152,9 @@ bool EventFilter::eventFilter(QObject* watched, QEvent* event)
|
|
|
QString keyName = keyEventToKeyString(kevent);
|
|
|
|
|
|
#ifdef Q_OS_WIN32
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (win32AppcommandBlackListedKeys.contains(keyName) && kevent->nativeVirtualKey())
|
|
|
- return QObject::eventFilter(watched, event);
|
|
|
+
|
|
|
+ if (win32BlackListedKeys.contains(keyName))
|
|
|
+ return true;
|
|
|
#endif
|
|
|
|
|
|
if (keystatus == InputBase::KeyDown)
|