Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As IntegerWhile True KeyState = GetAsyncKeyState(49) If KeyState < 0 Then KeyPress 49, 1 Delay 100 End If Delay 50Wend