ChaiLove API 2.1.0
joystick.h
1#ifndef SRC_LOVE_JOYSTICK_H_
2#define SRC_LOVE_JOYSTICK_H_
3
4#include <string>
5#include <vector>
6
7#include "Types/Input/Joystick.h"
8#include "pntr_app.h"
9
11
12namespace love {
13
17class joystick {
18 public:
19 ~joystick();
20 void load(pntr_app* app);
21
27 std::vector<Joystick*>& getJoysticks();
28
35
36 void unload();
37
46 bool isDown(int joystick, int button);
47
65 bool isDown(int joystick, const std::string& button);
66
83
84 int getButtonKey(const std::string& name);
85 std::string getButtonName(int key);
86
87 private:
88 std::vector<Joystick*> m_joysticks;
89 pntr_app* m_app;
90};
91
92} // namespace love
93
94#endif // SRC_LOVE_JOYSTICK_H_
Represents a physical joystick.
Definition Joystick.h:15
Provides an interface to connected joysticks.
Definition joystick.h:17
Joystick * operator[](int joystick)
Retrieve the given joystick.
int getJoystickCount()
Gets the number of connected joysticks.
bool isDown(int joystick, int button)
Checks if a button number is pressed on a joystick.
std::vector< Joystick * > & getJoysticks()
Gets a list of connected Joysticks.
bool isDown(int joystick, const std::string &button)
Checks if a button is pressed on a joystick.
This covers all the modules available through ChaiLove.
Definition audio.h:9