Re: Backtabbing into an NSTableView
Re: Backtabbing into an NSTableView
- Subject: Re: Backtabbing into an NSTableView
- From: Vadim <email@hidden>
- Date: Sun, 7 Jun 2009 00:02:04 +0300
An update on this question. It turns out the first bit of code does
not work after all, because 48 is the keyCode for [Tab] and [Shift
+Tab]. I needed to change the code to the following:
-(void)keyDown:(NSEvent *)theEvent
{
if ([theEvent keyCode] == 48 && ([theEvent modifierFlags] &
NSShiftKeyMask)) // 48 is the tab key
{
[self editColumn:1 row:[self selectedRow] withEvent:nil
select:YES];
return;
}
[super keyDown:theEvent];
}
Without the "return;" there is a "bing". To tell the truth, I'm not
sure why I get the "bing." I'm guessing that it has something to do
with the responder chain, but the thing is, the table can respond to
a backtab.
The second bit of code (Code B) works, but it gives a "bing" at
every keypress. Again, I'm thinking this has something to do with
the responder chain; but I'm not clear what. Any ideas?
According to the documentation, beeping is a standard reaction to
unhandled key event:
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#/
/apple_ref/doc/uid/10000060i-CH3-SW26
_______________________________________________
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