keyboard events
keyboard events
- Subject: keyboard events
- From: kubernan <email@hidden>
- Date: Sat, 9 Jun 2001 20:04:49 +0200
Bonjour,
My goal in my GUI app is to catch KeyUp and KeyDown events. It works
fine.
For that, i use an implementation of NSTextView.
My app contains one NSTextField where the user have to type some words.
I want to erase the content of this field when return key is pressed but
because
of catching KeyUp and KeyDown i can't. If i try to do that, my app
crashes.
My source code looks like this :
ProgramController.m
@interface NSTrackText : NSTextView
@end
@implementation ProgramController
- init
{
[super init];
blablablabla
}
// .... here i can update my NSTextField
@end
@implementation NSTrackText // where i know wich key is pressed...
- (void)keyDown:(NSEvent *)theEvent
{
// do something
}
- (void)keyUp:(NSEvent *)theEvent
{
// do something
}
@end
How can i erase my NSTextField when return key is pressed ?
Thx for your help !
Kub.