Re: WM_KEYDOWN
Re: WM_KEYDOWN
- Subject: Re: WM_KEYDOWN
- From: Half Activist <email@hidden>
- Date: Wed, 11 Apr 2007 11:26:37 +0200
I guess it seems complex to you but bear in minde that the
NSTextField class is high level object while keydown messages are
faily low level stuffs.
NSTextField is a full featured text field, what you're looking for is
not at that level, but certainly more at the NSResponder level.
I guess you only need to subclass NSResponder and grab the message,
and not forget to forward the message to the super class if you want
the NSTextField job to be done.
I think the method you'll have to overload is
- (void)keyDown:(NSEvent *)theEvent
so something like
- (void)keyDown:(NSEvent *)theEvent
{
// Do something with the key event
[ super keyDown: theEvent ];
}
should do the trick.
Regards.
A personal thought:
To me, Cocoa/OpenStep and MFC are hundreds of thousands miles
distant, it's just not worth comparing them.
On Apr 11, 2007, at 11:06 AM, xcocoa wrote:
I am looking for a way to get a simply MS Windows WM_KEYDOWN alike
message (notification) when using a NSTextField.
I have been reading lots of related msgs at www.cocoabuilder.com
and its incredible that something so easy in Windows, gets so
complex and hard in Cocoa.
I just want to be notified for the key pressed before it is shown
on the NSTextField ? Is NSFormatter the only way to go ?
Please, answer for a noob :-)
Thanks,
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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
References: | |
| >WM_KEYDOWN (From: xcocoa <email@hidden>) |