Re: Getting keyDowns
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