Can anyone please help me to get the keycodes for the arrow keys in c# .net keypress events? Can you help me to get out of this check point?
best regards, Arun.
Appendix B. Keyboard Key Code Values Key Key value Key Key value Arrow Up 38 F9 120 Backspace 8 F10 121 Caps Lock 20 F1 122 Ctrl 17 F12 123 45 more rows ...
KeyPress doesn't get fired for Arrows and the event args doesn't have a KeyCode property but for Arrow Keys in keyUp event they are: Show activity on this post.
For example, the A key on the keyboard produces the same key code when pressed, even though its character code might be 65 (uppercase A)or 97 (lowercase a), depending on whether the Shift key is down at the same time. Key codes are not influenced by modifier keys.
Appendix B. Keyboard Key Code Values Key Key value Key Key value Arrow Right 39 F8 119 Arrow Up 38 F9 120 Backspace 8 F10 121 Caps Lock 20 F1 122 45 more rows ...
http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx
Keys.Up, Keys.Left, Keys.Right, Keys.Down.
Do you mean the KeyUp event? KeyPress doesn't get fired for Arrows and the event args doesn't have a KeyCode property but for Arrow Keys in keyUp event they are:
Keys.Up, Keys.Down, Keys.Left, Keys.right
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With