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
 

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