OnKeyDown - two events?

  • Thread starter Thread starter Drew
  • Start date Start date
D

Drew

I'm having a problem with my OnKeyDown method generating two events
when a hardware button is pressed. It's like the button is getting pressed
twice.

Has anyone experienced anything like this?

Any ideas?

Thanks,

Drew
 
Which button is this occurring with? And what device are you using?

Peter
 
I am using a compaq ipaq 3835 for testing.

I am using the up arrow hardware button.

I was able to work around this by filtering
the OnKeyDown method with KeyEventArgs.KeyData
and now it's only receiving one event.

However, I did some testing on the desktop using the
full .NET framework and the behavior is not the same!

OnKeyDown (without any filter) only receives one event when I press a key.

Could this be a bug or am I not understanding something?

Drew
 
Hi Drew,

If I'm not mistaken, the hardware keys can sometimes send several
KeyDown events, because they have several mappings associated with
them.

If I remember well, on my iPaq h1930, the middle button sends three
events : one is "Return", the second is "Select" and the third is
"F23" (why F23???). Besides, when a MessageBox is shown, it doesn't
clear the buffer, which can complicate the matter further...

I had to resort to the same filtering you do...

HTH,

Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top