Re: Exit screen saver programmatically?
Re: Exit screen saver programmatically?
- Subject: Re: Exit screen saver programmatically?
- From: Gabriel Zachmann <email@hidden>
- Date: Thu, 24 Sep 2009 19:09:30 +0200
In that case, then you should pass the unwanted event to the
superclass, which will handle the event in that case.
Ah, you mean like this, I suppose?
[super keyDown: theEvent];
That seems to work like a charm. Thanks a million!
(For the record, I thought that user code is not supposed to call
keyDown and the likes,
that's why I tried this:
CGEventRef ourEvent = CGEventCreate(NULL);
CGPoint point = CGEventGetLocation(ourEvent); // get current
mouse location
point.x += 1.0;
ourEvent = CGEventCreateMouseEvent( NULL, kCGEventMouseMoved,
point, kCGMouseButtonCenter );
CGEventSetType(ourEvent, kCGEventMouseMoved);
CGEventPost( kCGSessionEventTap, ourEvent ); // post mouse moved
event
CFRelease( ourEvent );
But that sometimes worked, sometimes not.)
Best regards,
Gabriel.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden