How capture special keystorkes?

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I have a telnet application with a GUI.

When I hit ESC, CTRL-Z, etc... I want it to perform some custom actions.

How can I capture these keystrokes?
 
* "VB Programmer said:
I have a telnet application with a GUI.

When I hit ESC, CTRL-Z, etc... I want it to perform some custom actions.

How can I capture these keystrokes?

For some of the keystrokes: Add a MainMenu control and assign the
keystrokes as shortcuts for the menu items.
 
Good idea, but there is no Shortcut for the "esc" key. Any ideas on how I
can bind this?
 
* "VB Programmer said:
Good idea, but there is no Shortcut for the "esc" key. Any ideas on how I
can bind this?

I _wouldn't_ bind it. Esc is used to close a dialog (add a button and
set the form's 'CancelButton' property to the button).
 
this should do the trick

in the form keypress event

if asc(e.keychar) = keys.escape then
end if

If e.KeyCode = Keys.Enter Then
If Not ActiveControl Is Nothing Then
SendKeys.Send("{TAB}")
End If
End If

eric
 
Back
Top