It would be nice to have a MouseUp and TouchUp command. It can be use for example; clicking a button only execute once. MouseDown on the other hand always true on click, making it execute many times. So I added this on modules\mojo\input.csx
Example use in Cerberus would be..
Code:
Global __MouseDown:Bool
Function MouseUp( button=MOUSE_LEFT )
If device.KeyDown( KEY_LMB+button )
__MouseDown=True
Else
If __MouseDown
__MouseDown=False
Return True
endif
Endif
Return False
End
Global __TouchDown:Bool
Function TouchUp( index=0 )
If device.KeyDown( KEY_TOUCH0+index )
__TouchDown=True
Else
If __TouchDown
__TouchDown=False
Return True
endif
Endif
Return False
End
Example use in Cerberus would be..
Code:
If MouseUp()
Print ("Do something Once")
Endif