|
-
Jun 2nd, 2007, 06:20 PM
#1
Thread Starter
New Member
Using the keypad in an application
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
-
Jun 2nd, 2007, 07:30 PM
#2
Addicted Member
Re: Using the keypad in an application
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
-
Jun 3rd, 2007, 12:10 AM
#3
Thread Starter
New Member
Re: Using the keypad in an application
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
Last edited by dave123122; Jun 3rd, 2007 at 12:16 AM.
-
Jun 3rd, 2007, 12:21 AM
#4
Re: Using the keypad in an application
You'll have to detect global key presses, not just ones in your application.
You'd probably want to use the GetAsyncKeyState() API function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|