the following code as suggested by Steve works most of the time but every now and then it simply prints -13
Pete
sleep doesn't work, it doesn't catch the key
Code: (Select All)
Option _Explicit
Dim As Integer k
Dim As Double t
Print "Press a key"
t = Timer + 3.0 '<-- 2 seconds
Do
k = _KeyHit
Loop Until k Or (Timer > t)
Print k
Pete
sleep doesn't work, it doesn't catch the key