|
-
January 8th, 2001, 06:49 PM
#1
Is there a getkey function for vb???
Is there a function that will return the pressed key that i can use in a loop??? I want to find the pressed key or keys while i am in a loop. I dont want to use the built in keyboard functions for controls. Any ideas???
-
January 8th, 2001, 07:35 PM
#2
Re: Is there a getkey function for vb???
You could use this, and it will add the keys pressed to text1
Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
'the code
On Error Resume Next
Do: DoEvents
Dim X As Integer, i As Integer
For i = 32 To 256
X = GetAsyncKeyState(i)
If X = -32767 Then
text1 = text1 + Chr(i)
End If
Next
X = GetAsyncKeyState(8)
If X = -32767 Then
text1 = Mid(text1, 1, Len(text1) - 1)
End If
-
January 8th, 2001, 10:38 PM
#3
Re: Is there a getkey function for vb???
really? thanks! 
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
|