Re: Key down issue
Re: Key down issue
- Subject: Re: Key down issue
- From: Shawn Erickson <email@hidden>
- Date: Fri, 7 Nov 2003 08:23:47 -0800
On Nov 7, 2003, at 7:12 AM, Denis Vaillant wrote:
Hi everybody,
I am experiencing a little problem with the keyDown method
I have wrote this code
-(void)keyDown:(NSEvent *)theEvent
{
NSLog(@"[key down] : %@", [theEvent characters]);
}
In the log window, while pressing the 4 key, I get that :
2003-11-07 16:05:15.218 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:15.718 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:15.801 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:15.885 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:15.968 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:16.052 Cocoa OpenGL[2356] [key down] : 4
2003-11-07 16:05:16.135 Cocoa OpenGL[2356] [key down] : 4
I do not understand why there is delay of half a second between the
first
and the second time cocoa executes the method while it takes less than
0.01s
after ?
This is likely the key repeat delay which is a user configurable item.
Is it possible to remove this delay ?
This is a key down event so the key can be consider to be still down
until you get a key up event. Just setup a timer that does what you
want between the key down and key up event for the key in question. I
think that would be easiest solution without knowing more about what
you are trying to do.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.