Detecting Keyboard keys

  • Thread starter Thread starter Elmo Watson
  • Start date Start date
E

Elmo Watson

I can use Asc(e.KeyChar) to find out the keystrokes in the regular part of
the keyboard.

Is there any way to detect ASC value of either the F keys or the arrow keys?
 
I can use Asc(e.KeyChar) to find out the keystrokes in the regular part of
the keyboard.
Is there any way to detect ASC value of either the F keys or the arrow keys?

For finding keystrokes I would recoment KeyDown/KeyUp events with
e.KeyData.


E.g.

switch(e.KeyData) {
case Keys.Left: MessageBox.Show("Left");
case Keys.F2: MessageBox.Show("F2");
}

Select Case e.KeyData
Case Keys.Left: MessageBox.Show("Left")
Case Keys.F2: MessageBox.Show("F2")
End Select
 
Back
Top