Results 1 to 2 of 2

Thread: HOW TO CONTROL KEYBOARD BUFFER

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    7
    I wan't to Read the keyboard input Where ther is
    no text box active.

  2. #2
    Guest
    Use the GetAsyncKeyState API. Note: The following example does include any flitering.

    Make a Form with a CommandButton and a Timer.

    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Dim tmpStr
    
    Private Sub Command1_Click()
    
        Print tmpStr
        'Clear the String
        tmpStr = ""
    
    End Sub
    
    Private Sub Form_Load()
    
        'Set the Interval to 100. If you need a faster or slower speed, you
        'can change this
        Timer1.Interval = 100
        
    End Sub
    
    Private Sub Timer1_Timer()
    
        'Loop through all of the keys
        For I = 12 To 255
            If GetAsyncKeyState(I) Then tmpStr = tmpStr & Chr(I)
        Next I
        
    End Sub

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