• 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
Re: Getting keyDowns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting keyDowns


  • Subject: Re: Getting keyDowns
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 28 Aug 2001 13:16:08 +0200

Rosyna,

>>>>>> Rosyna (R) wrote at Mon, 27 Aug 2001 10:18:05 -0700:
R> Yes, however I had switched to using sendEvent because of that, and
R> disabled menu item keys still get blocked.

If you mean by that that your window subclas' sendEvent: does not get
Cmd-keys, then you are absolutely right -- that's how it is done. See the
NSResponder.html again:

=== NSResponder.html ===
Key Equivalents and Mnemonics
...
Key equivalents are dispatched by the NSApplication object's sendEvent:
method. On the Mach operating system, this results in a performKeyEquivalent:
message being sent to every NSWindow in the application until one of them
returns YES.
...
This difference in handling means that, among other things, NSWindow
subclasses shouldn't override performKeyEquivalent:.
...
=== cut here ===

Therefore, should you want to catch _Cmd_-keys, you have to sublass
NSApplication and override its sendEvent:.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: Getting keyDowns (From: "John C. Randolph" <email@hidden>)
 >Re: Getting keyDowns (From: Rosyna <email@hidden>)
 >Re: Getting keyDowns (From: Ondra Cada <email@hidden>)
 >Re: Getting keyDowns (From: Rosyna <email@hidden>)
 >Re: Getting keyDowns (From: Ondra Cada <email@hidden>)
 >Re: Getting keyDowns (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Using a variable in different class
  • Next by Date: Re: Learning to program Cocoa
  • Previous by thread: Re: Getting keyDowns
  • Next by thread: Scaling
  • Index(es):
    • Date
    • Thread