App that passes focus/events through to OS/other apps

I would like to create a Mac app that displays images/video on screen (semi transparently). Is it possible to do this and pass all focus/typing/mouse events through to the appropriate window underneath the transparent image window? In case I am not being clear, I want users to be able to use their computer and any of their apps while my app effects the screen content and does this by appearing (semi-transparently) above the other content on the screen.


I know this sounds like it will violate Apple's HIG, but the case where I want to do this will be allowed.

Accepted Reply

Yes, this is possible on macOS. Set the ignoresMouseEvents property of your window to true.


To make a window partially transparent, you have a couple of options. First, you can set the alphaValue of the window to something less than 1.0. Alternatively, you can set the window's opaque property to false and set its backgroundColor to a partially or completely transparent color. Then, the views within can draw as opaque or transparent as you like.

Replies

In the unlikely event that this is possible for iOS, I would also love to know how to do this for iOS devices.

Yes, this is possible on macOS. Set the ignoresMouseEvents property of your window to true.


To make a window partially transparent, you have a couple of options. First, you can set the alphaValue of the window to something less than 1.0. Alternatively, you can set the window's opaque property to false and set its backgroundColor to a partially or completely transparent color. Then, the views within can draw as opaque or transparent as you like.