It is currently Tue Mar 31, 2020 8:44 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to call CGEventSource.secondsSinceLastEventType
PostPosted: Wed Aug 28, 2019 5:07 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Mar 11, 2009 4:06 pm
Posts: 243
Location: NL
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to call CGEventSource.secondsSinceLastEventType
PostPosted: Wed Aug 28, 2019 5:37 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Mar 11, 2009 4:06 pm
Posts: 243
Location: NL
Ah, so I should look at ObjectiveC source samples instead of Swift...

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

Solved for now.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye