Add Autotype on Windows and MacOS (#63)

* Add Autotype on Windows, including Windows 10
* Add MacOS autotype, fix macdeployqt build
* Make QT_BINARY_DIR overwritable at compile time
This commit is contained in:
TheZ3ro 2016-11-08 22:13:57 +01:00 committed by Jonathan White
parent e25cd9ba48
commit 753b9c9e67
19 changed files with 1454 additions and 9 deletions

View file

@ -41,6 +41,25 @@ public:
return false;
}
};
#elif defined(Q_OS_WIN)
class WinEventFilter : public QAbstractNativeEventFilter
{
public:
bool nativeEventFilter(const QByteArray& eventType, void* message, long* result) override
{
Q_UNUSED(result);
if (eventType == QByteArrayLiteral("windows_generic_MSG")
|| eventType == QByteArrayLiteral("windows_dispatcher_MSG")) {
int retCode = autoType()->callEventFilter(message);
if (retCode == 1) {
return true;
}
}
return false;
}
};
#endif
Application::Application(int& argc, char** argv)
@ -49,6 +68,8 @@ Application::Application(int& argc, char** argv)
{
#if defined(Q_OS_UNIX) && !defined(Q_OS_OSX)
installNativeEventFilter(new XcbEventFilter());
#elif defined(Q_OS_WIN)
installNativeEventFilter(new WinEventFilter());
#endif
}