Implement Caps Lock warning

This commit is contained in:
Janek Bevendorff 2019-10-21 10:49:09 +02:00
parent 596d2cf425
commit d9214db404
12 changed files with 122 additions and 22 deletions

View file

@ -19,6 +19,9 @@
#include "MacUtils.h"
#include <QApplication>
#include <CoreGraphics/CGEventSource.h>
QPointer<MacUtils> MacUtils::m_instance = nullptr;
MacUtils::MacUtils(QObject* parent)
@ -85,3 +88,8 @@ bool MacUtils::enableScreenRecording()
{
return m_appkit->enableScreenRecording();
}
bool MacUtils::isCapslockEnabled()
{
return (CGEventSourceFlagsState(kCGEventSourceStateHIDSystemState) & kCGEventFlagMaskAlphaShift) != 0;
}