I am creating a program for a research project. I have a usb key pad (number pad) that is used as my input. I need to know how to have something happen when a certain key is pressed. The simpiler the better.
THX
Dave123122
Printable View
I am creating a program for a research project. I have a usb key pad (number pad) that is used as my input. I need to know how to have something happen when a certain key is pressed. The simpiler the better.
THX
Dave123122
Code:Option Explicit
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MsgBox "certain key is pressed"
End If
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
thank you SOOOOOOOOOOOO much it works awesome
i just have one question, how do i have it run in the background so that i can have another window ontop of it.
Dave123122
You'll have to detect global key presses, not just ones in your application.
You'd probably want to use the GetAsyncKeyState() API function.