VB 6.0, KeyUp,KeyDown, Problems
Is there any way to have something happen(let's say a car go forward) only while the up key is down. I was wondering this because I was making a drag racing game and I only want the car to go forward when the up key is down. Right now how I have it is you press the up key and the car keeps on going(I don't want that to happen). I tried the KeyUp command to fix this little problem but it doesn't work.
The code is below,
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyUp And d = False And c = True And g = True Then
If Form3.Label8.Caption = "Up" Then
Timer5.Enabled = True
Shape1.BackColor = vbGreen
End If
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyUp And d = False And c = True And a = True And g = True Then
If Form3.Label8.Caption = "Up" Then
Timer5.Enabled = False
Shape1.BackColor = vbRed
End If
End If
End Sub