34 lines
748 B
Plaintext
34 lines
748 B
Plaintext
/*
|
|
************************************************
|
|
*** Helpers.hws Example : HL.WaitForAction() ***
|
|
************************************************
|
|
*/
|
|
|
|
@INCLUDE "../../+Includes.hws"
|
|
@INCLUDE #INC_HELPERS
|
|
|
|
Function update_callback()
|
|
If IsKeyDown("SPACE")
|
|
Return(True)
|
|
Else
|
|
Return(False)
|
|
EndIf
|
|
|
|
EndFunction
|
|
|
|
Function timeout_callback()
|
|
NPrint("TIMED OUT!!!")
|
|
|
|
EndFunction
|
|
|
|
NPrint("HL.WaitForAction Example")
|
|
NPrint("------------------------\n")
|
|
|
|
NPrint("Hold down the 'p' key or the left mouse button, timeout is 10 seconds...")
|
|
NPrint("SPACE key is used to break the wait loop.")
|
|
HL.WaitForAction("p", 25, update_callback, 10000, timeout_callback, Nil)
|
|
|
|
NPrint("\n--- Left mouse button to quit ---")
|
|
Wait(50)
|
|
WaitLeftMouse()
|