Anyone got a working double tap function? Seem to be getting stuck with the keydown() and keyhit() combination.
Any help appreciated.
Any help appreciated.
Graphics 640,480,0,0 Global msg:String = "No double click" Global pause:Int While Not KeyDown(KEY_ESCAPE) Cls If Doubletap(KEY_MOUSELEFT) Then msg = "Double click" pause = MilliSecs() Else If MilliSecs() - pause > 1000 Then msg = "No Double Click" EndIf DrawText(msg,0,0) Flip Wend End Function DoubleTap:Int(key:Int, rate:Int = 1000) Global keys:Int[192] If KeyHit(key) Then If MilliSecs() - keys[key] <= rate Then keys[key] = MilliSecs() Return True Else keys[key] = MilliSecs() EndIf EndIf Return False End Function