ChaiLove API 2.1.0
Joystick Class Reference

Represents a physical joystick. More...

#include <Joystick.h>

Public Member Functions

std::string getName ()
 Gets the name of the joystick.
bool isDown (int button)
 Checks if a button on the Joystick is pressed.
bool isDown (const std::string &button)
 Checks if a button on the Joystick is pressed.
bool isConnected ()
 Gets whether the Joystick is connected.
int getID ()
 Gets the joystick's unique identifier.

Detailed Description

Represents a physical joystick.

Member Function Documentation

◆ getID()

Gets the joystick's unique identifier.

Returns
The index number of the Joystick.

◆ getName()

Gets the name of the joystick.

Returns
string The name of the Joystick.

◆ isConnected()

Gets whether the Joystick is connected.

Returns
True if the given joystick is connected.

◆ isDown() [1/2]

bool love::Types::Input::Joystick::isDown ( const std::string & button)

Checks if a button on the Joystick is pressed.

Parameters
buttonThe button to be checked
Returns
bool Whether or not the given button is down.

◆ isDown() [2/2]

Checks if a button on the Joystick is pressed.

Parameters
buttonThe index of the button to be checked
Returns
bool Whether or not the given button is down.