Controller#

Initializing the Controller Class#

To use a Controller in your project, start by initializing it as follows:

# Create a new object "controller" with the Controller class.
controller = Controller()

This controller object will be used in all subsequent examples throughout this API documentation when referring to Controller class methods and attributes.

The Controller class comes with two pre-defined attributes:

  • axis - Allows you to detect movements in the Controller’s joysticks and assign functions to axes events.

  • button - Allows you to detect button presses and assign functions to button events on the Controller.

Attributes