nCine::Backends::Qt5InputManager class

Parses and dispatches Qt5 input events.

Translates the Qt5 events forwarded by Qt5Widget into engine input state and events. Joystick support is provided through Qt5Gamepad when WITH_QT5GAMEPAD is enabled.

Base classes

class nCine::IInputManager
Interface for querying input state and dispatching input events.

Constructors, destructors, conversion operators

Qt5InputManager(Qt5Widget& widget)
The constructor takes care of opening available joysticks.
~Qt5InputManager()
The destructor releases every opened joystick.

Public functions

auto shouldQuitOnRequest() -> bool
Returns true if the application should quit on a close request.
auto event(QEvent* event) -> bool
Handles a generic Qt5 event, returning true if it was consumed.
void keyPressEvent(QKeyEvent* event)
Handles a Qt5 key press event.
void keyReleaseEvent(QKeyEvent* event)
Handles a Qt5 key release event.
void mousePressEvent(QMouseEvent* event)
Handles a Qt5 mouse button press event.
void mouseReleaseEvent(QMouseEvent* event)
Handles a Qt5 mouse button release event.
void mouseMoveEvent(QMouseEvent* event)
Handles a Qt5 mouse move event.
void touchBeginEvent(QTouchEvent* event)
Handles the start of a Qt5 touch sequence.
void touchUpdateEvent(QTouchEvent* event)
Handles an update within a Qt5 touch sequence.
void touchEndEvent(QTouchEvent* event)
Handles the end of a Qt5 touch sequence.
void wheelEvent(QWheelEvent* event)
Handles a Qt5 mouse wheel event.
auto mouseState() const -> const MouseState& override
Returns the current mouse state.
auto keyboardState() const -> const KeyboardState& override
Returns the current keyboard state.
auto isJoyPresent(int joyId) const -> bool override
Returns true if the specified joystick is connected.
auto joyName(int joyId) const -> const char* override
Returns the name of the specified joystick.
auto joyGuid(int joyId) const -> const JoystickGuid override
Returns the GUID of the specified joystick.
auto joyNumButtons(int joyId) const -> int override
Returns the number of buttons of the specified joystick.
auto joyNumHats(int joyId) const -> int override
Returns the number of hats of the specified joystick.
auto joyNumAxes(int joyId) const -> int override
Returns the number of axes of the specified joystick.
auto joystickState(int joyId) const -> const JoystickState& override
Returns the raw state of the specified joystick.
void setCursor(Cursor cursor) override
Sets the mouse cursor mode.