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: Juanjo Conti <email@hidden>
- Date: Fri, 30 Jan 2015 15:58:41 -0300
For the record, I'm capturing:
NSEventMask.RightMouseDownMask | NSEventMask.RightMouseUpMask |
NSEventMask.LeftMouseDownMask
| NSEventMask.LeftMouseUpMask | NSEventMask.MouseMovedMask |
NSEventMask.KeyDownMask
| NSEventMask.KeyUpMask | NSEventMask.ScrollWheelMask
An to exit I'm returning:
NSEvent.keyEventWithType(NSEventType.KeyDown, location: NSPoint(x: 0, y:0),
modifierFlags: NSEventModifierFlags(), timestamp: NSTimeInterval(),
windowNumber: 1, context: nil, characters: "imposiblekeyscombination",
charactersIgnoringModifiers: "imposiblekeyscombination", isARepeat: false,
keyCode: 0)
On Fri, Jan 30, 2015 at 3:09 PM, Juanjo Conti <email@hidden>
wrote:
> Thanks! this approach is hopeful! Now I just need to figure out which
> NSEvent return for all the captured events, so the screensaver close
> properly. I'll let you know my advances.
>
> Thanks again,
>
> On Fri, Jan 30, 2015 at 2:03 PM, Kyle Sluder <email@hidden> wrote:
>
>> 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
>
>
>
>
> --
>
> Juanjo Conti <jjconti <http://goog_2023646312>@carouselapps.com
> <email@hidden>>
>
> Software Engineer - Carousel Apps <https://carouselapps.com>
>
>
--
Juanjo Conti <jjconti <http://goog_2023646312>@carouselapps.com
<email@hidden>>
Software Engineer - Carousel Apps <https://carouselapps.com>
--
Carousel Apps Limited, registered in England & Wales with registered number
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel
App Ltd or any of its subsidiary, holding or affiliated companies or
entities (together "Watu") is confidential and may be privileged or
otherwise protected. If you receive it in error please inform us and then
delete it from your system. You should not copy it or disclose its contents
to anyone. Messages sent to and from Watu may be monitored to ensure
compliance with our internal policies and to protect our business. Emails
are not secure and cannot be guaranteed to be error free. Anyone who
communicates with us by email is taken to accept these risks.
_______________________________________________
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