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 Perturbatio
(Posted 18 years ago)
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

EdzUp[SD]
(Posted 18 years ago)
Doesnt work with movemouse like the Blitz3d version does.

Yan
(Posted 18 years ago)
Add a reset flag to X/Y functions and 'overload' movemouse to also call the X/Y functions with the reset flag set.

??

Ked
(Posted 18 years ago)
See here: http://www.blitzbasic.com/Community/posts.php?topic=82710

Code Archives Forum