I am trying to figure out how to code my program to notice when the "E" key is pressed outside of the form. How do i do this I am kind of lost. I have tried the following so far.....
What value do i put in for "e" i read its a numeric value and i found the virtual key list in the MSDN but the value it give me (in hex) doesnt work.
Is the getasynckeystate the right api to use? once this works i want to check for a couple more keys as well.
Code:Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vkey As Integer) As Short Dim test As Short Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load test = GetAsyncKeyState("e") End Sub




Reply With Quote