• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
keyboard events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: proof of cocoa superiority?
  • Next by Date: Displaying jpeg images
  • Previous by thread: Re: NSSplitView divider image
  • Next by thread: Displaying jpeg images
  • Index(es):
    • Date
    • Thread