• 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
Sheet window as firstResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sheet window as firstResponder


  • Subject: Sheet window as firstResponder
  • From: Lorenzo Bevilacqua <email@hidden>
  • Date: Fri, 25 Apr 2008 18:53:21 +0200

Hi,

I'm trying to get keyDown events from the contentView of a sheet window.
I overrided the acceptsFirstResponder method to return YES, and added a - (void) keyDown: (NSEvent *) event.


The problem is that when the sheet becomes visible and I press a key I hear a system alert and the keyDown isn't called.
I checked what's the nextResponder for that view (the window) and added keyDown method also for it, but same thing, beep and no keyDown.


I think that this problem is related to the fact that the window is modal.
I found something about modal windows looking in the documentation, but the informations aren't clear.


"NSWindow objects are passive participants in the modal-window mechanism; it's the application that programmatically initiates and manages modal behavior. To run a window modally, NSApp uses its normal event loop machinery but restricts input to a specific window or panel. In the loop, it fetches events but if the events do not meet certain criteria—most importantly their association with the modal window—it tosses them." (from Cocoa Fundamentals Guide - The Core Application Architecture - Windows - Modal windows)

How should I proceed?

Thanks,

Lorenzo Bevilacqua_______________________________________________

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: Sheet window as firstResponder
      • From: Sean Murphy <email@hidden>
  • Prev by Date: Re: mask nsimage
  • Next by Date: Re: Uniform Type Indicators
  • Previous by thread: Re: -init and awakeFromNib called twice.
  • Next by thread: Re: Sheet window as firstResponder
  • Index(es):
    • Date
    • Thread