Re: Screensaver can capture mouse events under Catalina
> >> I can confirm: this is indeed critical. Otherwise, the .saver does not >> receive mouse events. >> >> Unfortunately, it seems that I still cannot get key events. > > If you are trying to get events from arrow or modifier keys, you have to use > keyDown and not keyUp. But you may not be able to get any key events in a > screensaver for security reasons. Yes, I am defining - (void) keyDown: (NSEvent *) theEvent in my ScreenSaverView subclass, but it never gets called. Gab. smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
On May 25, 2020, at 3:43 PM, Gabriel Zachmann via Cocoa-dev wrote: > I can confirm: this is indeed critical. Otherwise, the .saver does not > receive mouse events. > > Unfortunately, it seems that I still cannot get key events. If you are trying to get events from arrow or modifier keys, you have to use keyDown and not keyUp. But you may not be able to get any key events in a screensaver for security reasons. Jim Crate ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
>> Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , >> the event is still passed on to the higher-up objects, so that makes the >> screensaver engine terminate the screensaver immediately. > > Does this mean you’re unable to set up a global event tap/monitor? If you > are able, how are you setting it up? I didn't try, because, like I said, it would be of no use to me, even if it did work, because the screensaver engine would still receive the event, and kill the screensaver immediately. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
Gabriel, > On May 26, 2020, at 04:21, Gabriel Zachmann wrote: > > Thanks a lot for your response! > > Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , > the event is still passed on to the higher-up objects, so that makes the > screensaver engine terminate the screensaver immediately. Does this mean you’re unable to set up a global event tap/monitor? If you are able, how are you setting it up? Sandor > > Best regards, Gabriel > > > >> On 26. May 2020, at 00:54, Sandor Szatmari >> wrote: >> >> Gabriel, (this is a dup reply, forgot to cc list) >> >> How are you setting up you global event monitor? >> >> I use this to handle catching mouse moved event when my app is not in the >> foreground…. maybe you use something like this >> Just watch out for a lot of events and making your app a CPU hog. >> >> [NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask >> handler: >>^(NSEvent * _Nonnull event) >>{ >> // Do stuff to handle events that I care about >>}]; >> >> Sandor > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
Thanks a lot for your response! Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , the event is still passed on to the higher-up objects, so that makes the screensaver engine terminate the screensaver immediately. Best regards, Gabriel > On 26. May 2020, at 00:54, Sandor Szatmari > wrote: > > Gabriel, (this is a dup reply, forgot to cc list) > > How are you setting up you global event monitor? > > I use this to handle catching mouse moved event when my app is not in the > foreground…. maybe you use something like this > Just watch out for a lot of events and making your app a CPU hog. > >[NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask > handler: > ^(NSEvent * _Nonnull event) > { >// Do stuff to handle events that I care about > }]; > > Sandor smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
Gabriel, (this is a dup reply, forgot to cc list) How are you setting up you global event monitor? I use this to handle catching mouse moved event when my app is not in the foreground…. maybe you use something like this Just watch out for a lot of events and making your app a CPU hog. [NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask handler: ^(NSEvent * _Nonnull event) { // Do stuff to handle events that I care about }]; Sandor > On May 25, 2020, at 18:35, Michael Diehr via Cocoa-dev > wrote: > > >> >> On May 25, 2020, at 12:43 PM, Gabriel Zachmann wrote: >> [...] >> Unfortunately, it seems that I still cannot get key events. >> Best regards, Gabriel > > I tried what feels like a thousand different variations and could not get key > events under Catalina screensaver. > If you can figure it out, please do share! > Mike > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com > > This email sent to admin.szatmari@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
I have to say, I'd be surprised if this were possible. From a security point of view, I can understand why Apple would want to prevent a screensaver from being able to capture keystrokes. > On 25 May 2020, at 11:34 pm, Michael Diehr via Cocoa-dev > wrote: > >> On May 25, 2020, at 12:43 PM, Gabriel Zachmann wrote: >> [...] >> Unfortunately, it seems that I still cannot get key events. >> Best regards, Gabriel > > I tried what feels like a thousand different variations and could not get key > events under Catalina screensaver. > If you can figure it out, please do share! > Mike > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/markjallan%40gmail.com > > This email sent to markjal...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
> On May 25, 2020, at 12:43 PM, Gabriel Zachmann wrote: > [...] > Unfortunately, it seems that I still cannot get key events. > Best regards, Gabriel I tried what feels like a thousand different variations and could not get key events under Catalina screensaver. If you can figure it out, please do share! Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
>> Also, I'm adding a NSTrackingArea (but not when the screensaver is in >> preview mode). I think this is critical to making it work, but can't say >> for certain. >> >> trackingArea = NSTrackingArea(rect:bounds, >> options:[NSTrackingArea.Options.activeAlways, >> NSTrackingArea.Options.mouseEnteredAndExited, >> NSTrackingArea.Options.mouseMoved], owner:self) >> self.addTrackingArea(trackingArea!) I can confirm: this is indeed critical. Otherwise, the .saver does not receive mouse events. Unfortunately, it seems that I still cannot get key events. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
Great question - I'm the author of iScreensaver. Although our editor app is primarily built using Xojo, the actual .saver file is now a proper Swift .saver file built using Xcode, which internally runs a JavaScript/HTML rendering engine in a WKWebView. I mention this detail in case it's important (e.g. does having a WKWebView matter?) My experience has been that Catalina tried really hard to break many features of screensavers. In any case, here's the code we use for capturing mouse events. Basically you set up a global handler, and then have to figure out how to route the event back to the correct screen (on a multi monitor system) and view... if isCatalinaOrHigher && mainScreen { func mouseEventMonitor (event:NSEvent) -> NSEvent? { log("# [\(screenNumber)] mouseDownEventMonitor event=\(event.description)") // this is a global handler for the App - so the event may be from any screen. // figure out which screen this is and route it appropriately for i in 0.. On May 25, 2020, at 6:17 AM, Gabriel Zachmann via Cocoa-dev > wrote: > >>> >>> https://iscreensaver.com >>> >> >> Looks like a macOS application with screen saver functionality. You could >> download it and try it > > It's a "screensaver builder": > you add a bunch of picture, "build" a screensaver, and that sits then in your > System Preferences' Desktop & Screensavers pane. > And it runs as a screensaver (well, actually, it gets run by macOS saver > engine). > >> there other pieces installed. Open up the app package and see what is >> inside. That might give > > It contains lots of frameworks (dylibs), most of which look like they're > copied from the macOS. > And two apps. > Nothing else of interest, AFAICS. > No source code available. > > After you build the screensaver, there is an actual plugin in > ~/Library/Screen Savers, > which is just a regular screen saver. > > When the saver runs and you move the mouse, you get an overlay , just like > with the video player, with icons like "forward", "pause"; you can click the > icons (e.g., pause the slide show). > > So I am wondering very much how they do that. > > > Best regards, Gabriel > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/md03%40xochi.com > > This email sent to m...@xochi.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
>> >> https://iscreensaver.com >> > > Looks like a macOS application with screen saver functionality. You could > download it and try it It's a "screensaver builder": you add a bunch of picture, "build" a screensaver, and that sits then in your System Preferences' Desktop & Screensavers pane. And it runs as a screensaver (well, actually, it gets run by macOS saver engine). > there other pieces installed. Open up the app package and see what is inside. > That might give It contains lots of frameworks (dylibs), most of which look like they're copied from the macOS. And two apps. Nothing else of interest, AFAICS. No source code available. After you build the screensaver, there is an actual plugin in ~/Library/Screen Savers, which is just a regular screen saver. When the saver runs and you move the mouse, you get an overlay , just like with the video player, with icons like "forward", "pause"; you can click the icons (e.g., pause the slide show). So I am wondering very much how they do that. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screensaver can capture mouse events under Catalina
> On May 25, 2020, at 6:39 AM, Gabriel Zachmann via Cocoa-dev wrote: > > Here is a screensaver (actually, screensaver builder) that can capture mouse > events: > > https://iscreensaver.com > > Does anyone have an idea how they might be able to do it? > > Best regards, Gabriel Looks like a macOS application with screen saver functionality. You could download it and try it out and see how they do things. What does the installer do. Does simply install an app or are there other pieces installed. Open up the app package and see what is inside. That might give you a hint. --Richard Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Screensaver can capture mouse events under Catalina
Here is a screensaver (actually, screensaver builder) that can capture mouse events: https://iscreensaver.com Does anyone have an idea how they might be able to do it? Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com