AftGangAglay Documentation


getbuttons

New in 2.2.0

Parameters

N/A

Return Value

Type Description
int[3] A list of 3 ints corresponding to the left, right and middle mouse button states.

Description

Retrieves the mouse button states this frame. All values where the button is held are truthy.

States

Name Description
CLICKButton became pressed this frame
DOWNButton is pressed
UPButton is released

Example

import agan

class game():
	def create(self):
		return self
	#
	def update(self):
		b = agan.getbuttons()
		#
		if(b[0] == agan.CLICK): agan.log('LMB was clicked')
		#
		if(b[1] == agan.DOWN): agan.log('RMB is held')
		#
		if(b[2] == agan.UP): agan.log('MMB is not held')
	#
	def close(self):
		pass