Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
- Subject: Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
- From: Ken Thomases <email@hidden>
- Date: Sat, 8 Aug 2009 02:18:26 -0500
On Aug 6, 2009, at 7:03 PM, Dimcho Balev wrote:
I have a trouble with a piece of code which behaves differently on
Tiger (Mactel) in comparison to Leopard.
It is pretty simple case: our cocoa app is interested in cmd+key
shortcuts and we have overriden the keyDown and keyUp methods in our
NSWindow inherited class. On Leopard we receive all of the key events
without a problem but on Tiger the standard cmd+key events (cmd+c, cmd
+v, cmd+x, cmd+a) are filtered out. I tried out few other approaches -
for instance using flagsChanged to detect the cmd key status but I
never receive an event for the 2nd key (m,c,v,x, or a) of the
shortcut.
I am wondering if this is known issue with Tiger and if there is any
workaround.
When you suspect a difference between two versions of the OS, you
should see if it's mentioned in the release notes of the newer
version(s). In this case, check the Leopard AppKit release notes <http://developer.apple.com/releasenotes/Cocoa/AppKit.html
> and search for "key equivalents". You'll find this:
"In -[NSWindow sendEvent:] we now send keyDown: to the first responder
even if the command-key modifier is set. An NSKeyDown event will only
reach this point if it was not recognized as a key equivalent. One
effect of this change is to enable custom key binding entries with
command-key modifiers. The change applies only to applications built
on Leopard or later, to preserve binary compatibility for any
application which may have been dependent on the old behavior."
Regards,
Ken
_______________________________________________
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