469,613 Members | 1,267 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

How capture special keystorkes?

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?
Nov 20 '05 #1
4 1243
* "VB Programmer" <gr*********@go-intech.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Good idea, but there is no Shortcut for the "esc" key. Any ideas on how I
can bind this?

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* "VB Programmer" <gr*********@go-intech.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
* "VB Programmer" <gr*********@go-intech.com> scripsit:
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).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
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

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* "VB Programmer" <gr*********@go-intech.com> scripsit:
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).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Barinstein | last post: by
reply views Thread by Tsunami | last post: by
reply views Thread by j101 | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.