mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-26 16:25:23 -04:00
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:
parent
e25cd9ba48
commit
753b9c9e67
19 changed files with 1454 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue