Closed ErikBjare closed 7 years ago
Since I'm now in possession of a Mac, I can actually do this.
We'd simply create a new file macos.py
containing the necessary and remove the support for it in unix.py
.
Especially important due to this problem.
Turns out it was as easy as:
from Quartz.CoreGraphics import (CGEventSourceSecondsSinceLastEventType,
kCGEventSourceStateHIDSystemState,
kCGAnyInputEventType)
seconds_since_input = CGEventSourceSecondsSinceLastEventType(kCGEventSourceStateHIDSystemState, kCGAnyInputEventType)
This API should do it: https://developer.apple.com/documentation/coregraphics/cgeventsource/1408790-secondssincelasteventtype