ChaiLove API 2.1.0
Joystick.h
1#ifndef SRC_LOVE_TYPES_INPUT_JOYSTICK_H_
2#define SRC_LOVE_TYPES_INPUT_JOYSTICK_H_
3
4#include <string>
5
6#include "pntr_app.h"
7
8namespace love {
9namespace Types {
10namespace Input {
11
15class Joystick {
16 public:
17 Joystick();
18 Joystick(pntr_app* app, int index);
19
25 std::string getName();
26
27 pntr_app* m_app;
28
36 bool isDown(int button);
37
45 bool isDown(const std::string& button);
46
53
59 int getID();
60
61 private:
62 int m_index = 0;
63 bool m_connected = true;
64};
65
66} // namespace Input
67} // namespace Types
68} // namespace love
69
70#endif // SRC_LOVE_TYPES_INPUT_JOYSTICK_H_
int getID()
Gets the joystick's unique identifier.
std::string getName()
Gets the name of the joystick.
bool isConnected()
Gets whether the Joystick is connected.
bool isDown(const std::string &button)
Checks if a button on the Joystick is pressed.
bool isDown(int button)
Checks if a button on the Joystick is pressed.
This covers all the modules available through ChaiLove.
Definition audio.h:9