class EE::Window::JoystickManager


A Joystick Manager class. More…

#include <joystickmanager.hpp>

class JoystickManager {
    // typedefs

    typedef std::function<void()> OpenCb;

    // construction

    virtual ~JoystickManager();

    // methods

    Uint32 getCount();
    virtual void update() = 0;
    Joystick* getJoystick(const Uint32& index);
    virtual void rescan();
    virtual void close();
    virtual void open(OpenCb openCb = nullptr);

Detailed Documentation

A Joystick Manager class.


Uint32 getCount()


The number of joysticks attached to the system

virtual void update() = 0

Update the states of all joysticks

Joystick* getJoystick(const Uint32& index)


The joystick instante of the joystick index

virtual void rescan()

Rescan all joysticks to look for new joystick connected. This could be slow on some backends, and unnecessary on others.

virtual void close()

Close all the joysticks

virtual void open(OpenCb openCb = nullptr)

Open all the joysticks