How to call CGEventSource.secondsSinceLastEventType

Mac OSX specific forum
Rinzwind
Enthusiast
Enthusiast
Posts: 690
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

How to call CGEventSource.secondsSinceLastEventType

Post by Rinzwind »

Any mac guru knows how to translate this piece to PB?

; var lastEvent:CFTimeInterval = 0
; lastEvent = CGEventSource.secondsSinceLastEventType(CGEventSourceStateID.hidSystemState, eventType: CGEventType(rawValue: ~0)!)

AFAIK:
hidSystemState is a constant with value 1. That ~0 matches kCGAnyInputEventType.
secondsSinceLastEventType is a class method. Can't find an example of calling one.

Any help appreciated.
Rinzwind
Enthusiast
Enthusiast
Posts: 690
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: How to call CGEventSource.secondsSinceLastEventType

Post by Rinzwind »

Ah, so I should look at ObjectiveC source samples instead of Swift...

ImportC ""
CGEventSourceSecondsSinceLastEventType.d(CGEventSourceStateID.l, CGEventType.l)
EndImport

Solved for now.
Post Reply