class EE::Window::JoystickManager

Overview

A Joystick Manager class. More…

#include <joystickmanager.hpp>

class JoystickManager {
public:
    // 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.

Methods

Uint32 getCount()

Returns:

The number of joysticks attached to the system

virtual void update() = 0

Update the states of all joysticks

Joystick* getJoystick(const Uint32& index)

Returns:

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