AftGangAglay Documentation


getmotion

Parameters

N/A

Return Value

Type Description
float[2] A list of 2 floats containing the mouse cursor X and Y motion.

Description

Retrieves the mouse cursor motion this frame in terms of X and Y deltas. The exact metric reported varies by platform.

Example

import agan

class game():
	def create(self):
		return self
	#
	def update(self):
		m = agan.getmotion()
		#
		if(m[0] > 0.0):
			agan.log("Mouse is moving right")
		elif(m[0] < 0.0):
			agan.log("Mouse is moving left")
		else:
			agan.log("Mouse is not moving left or right")
		#
		if(m[1] > 0.0):
			agan.log("Mouse is moving down")
		elif(m[1] < 0.0):
			agan.log("Mouse is moving up")
		else:
			agan.log("Mouse is not moving up or down")
	#
	def close(self):
		pass