Code archives/User Input/MouseXSpeed, MouseYSpeed and MouseZSpeed

This code has been declared by its author to be Public Domain code.

Download source code

MouseXSpeed, MouseYSpeed and MouseZSpeed by Perturbatio2008
For help with B3D users converting to BMax
Function MouseXSpeed:Int()
	Global lastX:Int =0
	Local result:Int = MouseX()-lastX
	lastX = MouseX()	
	Return result
End Function


Function MouseYSpeed:Int()
	Global lastY:Int =0
	Local result:Int = MouseY()-lastY
	lastY = MouseY()	
	Return result
End Function


Function MouseZSpeed:Int()
	Global lastZ:Int =0
	Local result:Int = MouseZ()-lastZ
	lastZ = MouseZ()	
	Return result
End Function

Comments

*2009
Doesnt work with movemouse like the Blitz3d version does.


Yan2009
Add a reset flag to X/Y functions and 'overload' movemouse to also call the X/Y functions with the reset flag set.

??


Ked2009
See here: http://www.blitzbasic.com/Community/posts.php?topic=82710


Code Archives Forum