• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Need help filtering mouse events in an overlay child window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help filtering mouse events in an overlay child window


  • Subject: Need help filtering mouse events in an overlay child window
  • From: Michael Crawford <email@hidden>
  • Date: Fri, 11 May 2012 21:35:50 -0400

I'd like to act on -mouseDown when it occurs within the bounds of an NSImageView, which is a subview of a transparent overlay child window.  Some of you may be wondering why I'm trying to do this so I'll try to explain that up front.  There are bugs in Snow Leopard regarding the use of Core Animation with layer-backed views and NSOutlineView.  In order to avoid these bugs, which I'm told Apple will not be fixing for 10.6, I'm using a transparent overlay to do the required animation and implement something like QuickLook or a preview function.

I tried the following code but it resulted in really bad latency and coordinate issues (I think) in the parent window's event handling.

#pragma mark - NSEvent Handling Methods

- (void)mouseDown:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
#if 0
    [super mouseDown:event];
    [self.parentWindow removeChildWindow:self];
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [self close];
    }];
#endif
}

- (void)mouseDragged:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
}

- (void)mouseEntered:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
}

- (void)mouseExited:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
}

- (void)mouseMoved:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
}

- (void)mouseUp:(NSEvent *)event
{
    [self.parentWindow sendEvent:event];
}

I'm thinking that the way I'm forwarding events to the parent is wrong.  So I'm looking for advice on implementing a proper mouse filter that can forward events and generate the same result as if the event was originally sent to the parent window.

-Michael
_______________________________________________

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

  • Follow-Ups:
    • Re: Need help filtering mouse events in an overlay child window
      • From: Gideon King <email@hidden>
  • Prev by Date: Re: Funky file URLs from drag & drop
  • Next by Date: Re: Need help filtering mouse events in an overlay child window
  • Previous by thread: Re: Funky file URLs from drag & drop
  • Next by thread: Re: Need help filtering mouse events in an overlay child window
  • Index(es):
    • Date
    • Thread