ChaiLove API  0.28.0
Public Member Functions
love::Types::Input::Joystick Class Reference

Represents a physical joystick. More...

Public Member Functions

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

Detailed Description

Represents a physical joystick.

Member Function Documentation

◆ getID()

int love::Types::Input::Joystick::getID ( )

Gets the joystick's unique identifier.

Returns
The index number of the Joystick.

◆ getName()

std::string love::Types::Input::Joystick::getName ( )

Gets the name of the joystick.

Returns
string The name of the Joystick.

◆ isConnected()

bool love::Types::Input::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 ( int  button)

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.

◆ isDown() [2/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.