On Jul 7, 2008, at 5:07 PM, Graham Cox wrote:
The view that is first responder needs to override -keyDown: and do
this:
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
which hooks the event into the standard dispatcher for these methods.
(One thing that has long puzzled
On Jul 8, 2008, at 3:02 PM, [EMAIL PROTECTED] wrote:
Okay, got this message late though it looks like another had responded
to it already. Given that I need to override -keyDown: (or -
performKeyEquivalent:) in applicable first responders anyway, and it
doesn't really read well to have
I want to be able to delete the items selected in a view, but am
struggling finding a best way to turn the different key presses into a
-delete: action that my controller can handle. I think I want (it
seems expected functionality anyway) the delete key, the forward
delete key, as well as
On Jul 7, 2008, at 5:29 PM, Nathan Vander Wilt wrote:
I want to be able to delete the items selected in a view, but am
struggling finding a best way to turn the different key presses
into a -delete: action that my controller can handle. I think I
want (it seems expected functionality
The Cocoa Text Bindings system already translates keys and key
combinations into invocations of NSResponder methods. http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/chapter_9_section_1.html
So, what you need to do is determine which methods those
Hi Nathan,
By overriding -keyDown: and not calling [super keyDown:keyEvent], you
have stopped your view from actually processing the keys any further.
That's why you aren't getting to either of the delete methods.
Hope this helps,
- Greg
On Jul 7, 2008, at 4:59 PM, Nathan Vander
The view that is first responder needs to override -keyDown: and do
this:
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
which hooks the event into the standard dispatcher for these methods.
(One thing that has long puzzled me about this though - why is the
parameter an
On Jul 7, 2008, at 6:59 PM, Nathan Vander Wilt wrote:
Thanks, I forgot to mention that I tried overriding some of those
action methods. However, I couldn't get them to fire.
If I implement:
- (BOOL)acceptsFirstResponder {
return YES;
}
- (void)keyDown:(NSEvent*)keyEvent {
By overriding -keyDown: and not calling [super keyDown:keyEvent],
you have stopped your view from actually processing the keys any
further. That's why you aren't getting to either of the delete
methods.
Hmm, the flowchart I mentioned