Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
JoysticksController.hpp
Go to the documentation of this file.
1
16
17#ifndef JOYSTICKS_CONTROLLER_HPP
18#define JOYSTICKS_CONTROLLER_HPP
19
20#include <QObject>
21#include <SDL2/SDL.h>
22#include <functional>
23
28class JoysticksController : public QObject
29{
30 Q_OBJECT
31
32private:
33 SDL_Joystick *m_joystick;
34 std::function<void(int)> m_updateSteering;
35 std::function<void(int)> m_updateSpeed;
37
38public:
39 JoysticksController(std::function<void(int)> steeringCallback,
40 std::function<void(int)> speedCallback,
41 QObject *parent = nullptr);
43 bool init();
44 void requestStop();
45
46public slots:
47 void processInput();
48
49signals:
50 void finished();
51};
52
53#endif // JOYSTICKS_CONTROLLER_HPP
JoysticksController(std::function< void(int)> steeringCallback, std::function< void(int)> speedCallback, QObject *parent=nullptr)
Construct a JoysticksController object.
void requestStop()
Requests the joystick controller to stop.
std::function< void(int)> m_updateSpeed
bool init()
Initializes the joystick controller.
void processInput()
Runs the joystick controller loop.
~JoysticksController()
Destruct a JoysticksController object.
std::function< void(int)> m_updateSteering