Skip navigation.
 
mlRe: Problems with keyboard shortcuts without modifiers
FROM : j o a r
DATE : Tue Feb 12 20:47:39 2008

On Feb 12, 2008, at 8:39 AM, David Simpson wrote:

> I have a few keyboard shortcuts in my application that do not 
> require any
> modifier to use.  These work fine in my main window.  When I open 
> another,
> very simple window that has an NSTextField (its opened through an
> NSWindowController), if i hit a shortcut key as I type into that 
> text field,
> it invokes the shortcut and does not enter into the text field.



These shortcuts are set up in your main menu, right?
Unfortunately I don't think that there is a simple solution for this 
problem.

A couple of suggestions for workarounds that might, or might not, work 
in your case:

* Add some hacks to your menu item validation to make sure that your 
non-modifier items are disabled when your non-main windows are key.

* Add a NSApplication subclass and override "-sendEvent:" to control 
who sees these shortcuts first.

I hope that I'm wrong, and that someone else posts a better solution 
to this problem, but if I'm not, I suggest that you file a bug 
report / enhancement request with Apple:

   <http://developer.apple.com/bugreporter/>

j o a r

Related mailsAuthorDate
mlProblems with keyboard shortcuts without modifiers David Simpson Feb 12, 17:39
mlRe: Problems with keyboard shortcuts without modifiers j o a r Feb 12, 20:47