Re: Subverting the first responder chain

2008-03-31 Thread John Stiles
hn Stiles [mailto:[EMAIL PROTECTED] Sent: Fri 3/28/2008 2:35 PM To: Allen Smith Cc: cocoa dev Subject: Re: Subverting the first responder chain I did a test and if I call [[self nextResponder] keyDown:theEvent]; from inside the -keyDown: method, it does in fact trigger the appropriate hot

RE: Subverting the first responder chain

2008-03-28 Thread Allen Smith
CTED] Sent: Fri 3/28/2008 2:35 PM To: Allen Smith Cc: cocoa dev Subject: Re: Subverting the first responder chain I did a test and if I call [[self nextResponder] keyDown:theEvent]; from inside the -keyDown: method, it does in fact trigger the appropriate hotkey on the menu. (On the other

Re: Subverting the first responder chain

2008-03-28 Thread John Stiles
I did a test and if I call [[self nextResponder] keyDown:theEvent]; from inside the -keyDown: method, it does in fact trigger the appropriate hotkey on the menu. (On the other hand, the documentation recommends your technique of handing off to super here: http://developer.apple.com/d

Re: Subverting the first responder chain

2008-03-28 Thread Allen Smith
On Mar 27, 2008, at 8:12 PM, John Stiles wrote: Wow, this sounds like a disaster. Maybe in my -keyDown: call I can walk the menus in the menu bar and call -performKeyEquivalent on all of them. It's probably not fast :| I was in the process of writing code that stores the menu bar's key e

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
Wow, this sounds like a disaster. Maybe in my -keyDown: call I can walk the menus in the menu bar and call -performKeyEquivalent on all of them. It's probably not fast :| I was in the process of writing code that stores the menu bar's key equivalents in a hash table and checks the hash table b

Re: Subverting the first responder chain

2008-03-27 Thread Ken Thomases
On Mar 27, 2008, at 7:52 PM, John Stiles wrote: I am implementing a custom NSView subclass (actually a simple subclass of NSOpenGLView) that implements -keyDown: in order to respond to user typing. Typically, this works great. However, I have a few menu items which respond to atypical hotke

Re: Subverting the first responder chain

2008-03-27 Thread Hamish Allan
On Fri, Mar 28, 2008 at 1:14 AM, John Stiles <[EMAIL PROTECTED]> wrote: > The view doesn't immediately have a way of knowing whether it should handle > a key like "space" or not. The app design is predicated around the idea that > keyboard shortcuts will be consumed before they reach the view, wh

Re: Subverting the first responder chain

2008-03-27 Thread John Stiles
The view doesn't immediately have a way of knowing whether it should handle a key like "space" or not. The app design is predicated around the idea that keyboard shortcuts will be consumed before they reach the view, which I think is reasonable, and matches reality for standard command keys.

Re: Subverting the first responder chain

2008-03-27 Thread Hamish Allan
On Fri, Mar 28, 2008 at 12:52 AM, John Stiles <[EMAIL PROTECTED]> wrote: > However, I have a few menu items which respond to atypical hotkeys (e.g. > one responds to "space", another to "option+X"). In this case, I've > found that the view gets a -keyDown: event, which it dutifully handles, Pe

Subverting the first responder chain

2008-03-27 Thread John Stiles
I am implementing a custom NSView subclass (actually a simple subclass of NSOpenGLView) that implements -keyDown: in order to respond to user typing. Typically, this works great. However, I have a few menu items which respond to atypical hotkeys (e.g. one responds to "space", another to "optio