Sign in to follow this  
Khaos Dragon

..net keydown event registering multiple times

Recommended Posts

Khaos Dragon    196
In my c# app, I need a callback to respond only when a key is first initially pressed. However for some reason, the "KeyDown" event seems to generated constantly while the key is held down and in this respect is acting just like the keypress event. All my google research seems to have found no one with this problem with their keydown event working as advertised in the sdk. I am wondering if there might be a reason for this? If not, then is there a way to disable buffered keyboard input in my application?

Share this post


Link to post
Share on other sites
Telastyn    3777
Eh? IIRC, the keydown event is 'as advertised' supposed to trigger multiple times.

*doublechecks Petzold* Yes, that's expected behavior.

Share this post


Link to post
Share on other sites
d_emmanuel    271
As the others have said this is actually the correct behavior for the key down event in both .NET and Win32. To find out more specifics do a search on MSDN for OnKeyDown, OnKeyPress or KeyPressEventArgs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this