Re: How to avoid user interaction in WebView
Re: How to avoid user interaction in WebView
- Subject: Re: How to avoid user interaction in WebView
- From: Kyle Sluder <email@hidden>
- Date: Fri, 30 Jan 2015 09:03:11 -0800
On Jan 30, 2015, at 7:47 AM, Juanjo Conti <email@hidden> wrote:
>
> Hi! This is my first email in this list. I'm working with Cocoa (using
> Swift) on a Mac Os X screensaver.
>
> I'd like to use a WebView to show different web pages but I don't want the
> user to be able to interact with the page. This is: no clicking, no
> scrolling, no keystrokes firing events in the web pages...
>
> How can I achieve this?
The easiest and most resilient approach might be to add a local event monitor (using +[NSEvent addLocalMonitor…]) that filters out all keyboard and mouse events targeted at your window. Especially since you probably want any of these actions to dismiss the screensaver.
You’ll want to be careful to restrict this only to the window that draws your screensaver, and only to keyboard/mouse/other input events.
--Kyle Sluder
_______________________________________________
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