Details
-
Suggestion
-
Resolution: Won't Do
-
P3: Somewhat important
-
4.3.3
-
None
Description
On Windows it seems that it is possible to get pretty much get any event by using QCoreApplication::winEventFilter. On Mac however
it seems that Qt only register a subset of events (see
qapplication_mac.cpp). That is fine however it would be great if we
could still use the Carbon call: AddEventTypesToHandler, to do something
like this:
EventTypeSpec switchEventTypes[2];
switchEventTypes[0].eventClass = kEventClassSystem;
switchEventTypes[0].eventKind = kEventSystemUserSessionDeactivated;
switchEventTypes[1].eventClass = kEventClassSystem;
switchEventTypes[1].eventKind = kEventSystemUserSessionActivated;
OSStatus err= AddEventTypesToHandler (app_proc_handler, 2,
switchEventTypes);
Unfortunately it does not seem possible because app_proc_handler is a
static and is not exposed through any interface I could find. Instead
one has to re-create a separate Event Handler.
This would be useful for detecting user switching, changes in network configuration, when the computer is put to sleep/woken up.