Results 1 to 4 of 4

Thread: Using the keypad in an application

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    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

  2. #2
    Addicted Member cxj98's Avatar
    Join Date
    Feb 2007
    Posts
    170

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    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.

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    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
  •  



Click Here to Expand Forum to Full Width