Can anyone tell me when KeyPress event is raised

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I noticed that I don't get KeyDown nor KetPress events if NumLock is not on.

I can probably find a workaround but it would be nice to know what the rules
are.

Can anyone tell me when KeyPress event is raised and when it isn't.



Thanks
 
Key events occur in the following order:

1. KeyDown
2. KeyPress
3. KeyUp

The KeyPress event is not raised by noncharacter keys; however, the
noncharacter keys do raise the KeyDown and KeyUp events.

Do you have a more specific question than the order?

Chris
 
Are you sure the keypad keys with NumLock off cause a KeyDown event?

I have a

Debug.WriteLine("KEYDOWN " & e.KeyValue.ToString)

at the top of the sub that handles and I see the effect of pressing the
keypad keys if NumLock is on but if I press NumLock to turn it off the
prints stop until I press it again to turn it on

Think I'm missing something?



Thanks a lot
 
It not the entire keypad that does not cause a KeyDown event - only the
arrow keys 4, 8, 6 and 2
Which are, naturally, the ones I'm interested in.
 
Back
Top