Justin wrote:
How can I upgrade this to detect multiple keystrokes? For example
CRTL + E
The API call you mention will tell you the state of any key on the keyboard,
so if you want to tell whether CTRL + E is pressed, check to see whether the
Ctrl key is pressed, and if it is, check to see whether the E key is
pressed. If it returns True for both, those two keys (among others,
possibly) are pressed.
Depending on what you're doing, it would probably be better to handle this
using the KeyDown events of a form or control, though:
\\\
If e.KeyCode = Keys.E AndAlso e.Control = True Then
MsgBox("Ctrl+E was pressed")
End If
///
If you add that to the form's KeyDown event and set the form's KeyPreview
date to True, this will fire every time Ctrl+E is pressed while the form has
focus.
--
(O)enone