PDA

Click to See Complete Forum and Search --> : HOW TO CONTROL KEYBOARD BUFFER


chamara
Jul 29th, 2000, 11:27 PM
I wan't to Read the keyboard input Where ther is
no text box active.

Jul 30th, 2000, 08:26 AM
Use the GetAsyncKeyState API. Note: The following example does include any flitering.

Make a Form with a CommandButton and a Timer.


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