Re: Up arrow in NSTextView
Re: Up arrow in NSTextView
- Subject: Re: Up arrow in NSTextView
- From: Adam <email@hidden>
- Date: Tue, 29 Mar 2005 19:01:45 -0500
Worked like a charm, thank you!
Adam
On Mar 29, 2005, at 6:53 PM, Charilaos Skiadas wrote:
This is what I do in my text field's delegate:
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
doCommandBySelector:(SEL)command
{
NSLog(@"Handling event");
if ((command == @selector(moveDown:))) {
[self moveInHistoryDown:control];
return YES;
}
if ((command == @selector(moveUp:))) {
[self moveInHistoryUp:control];
return YES;
}
return NO;
}
On Mar 29, 2005, at 5:35 PM, Adam wrote:
Douh, I was actually talking about an NSTextField, however, I assume
the advice would be exactly the same.
Adam
On Mar 29, 2005, at 4:30 PM, Oliver Cameron wrote:
This is what I do, replace the unicode char number for the up key:
- (void)keyDown:(NSEvent *)theEvent
{
unichar unicodeChar;
NSString *characters;
characters = [theEvent characters];
unicodeChar = [characters characterAtIndex:0];
if (unicodeChar == 0x0009)
{
Do whatever happens on up key.
}
}
This is in a NSTextView subclass.
Thanks,
On 29 Mar 2005, at 22:23, Adam wrote:
What is the easiest way for me to detect that the user has pressed
a specific key in an NSTextView?
Adam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden