QWaylandInputDevice Class

The QWaylandInputDevice class provides access to keyboard, mouse, and touch input. More...

Header: #include <QWaylandInputDevice>
qmake: QT += waylandcompositor
Inherits: QWaylandObject

This class is under development and is subject to change.

Public Types

enum CapabilityFlag { Pointer, Keyboard, Touch }
flags CapabilityFlags

Public Functions

QWaylandInputDevice(QWaylandCompositor *compositor, CapabilityFlags capabilityFlags = DefaultCapabilities)
virtual ~QWaylandInputDevice()
QWaylandInputDevice::CapabilityFlags capabilities() const
QWaylandCompositor *compositor() const
QWaylandDrag *drag() const
QWaylandKeyboard *keyboard() const
QWaylandSurface *keyboardFocus() const
QWaylandView *mouseFocus() const
QWaylandPointer *pointer() const
void sendFullKeyEvent(QKeyEvent *event)
void sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event)
void sendFullTouchEvent(QTouchEvent *event)
void sendKeyPressEvent(uint code)
void sendKeyReleaseEvent(uint code)
void sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos = QPointF())
void sendMousePressEvent(Qt::MouseButton button)
void sendMouseReleaseEvent(Qt::MouseButton button)
void sendMouseWheelEvent(Qt::Orientation orientation, int delta)
void sendTouchCancelEvent()
void sendTouchFrameEvent()
void sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state)
bool setKeyboardFocus(QWaylandSurface *surface)
void setKeymap(const QWaylandKeymap &keymap)
void setMouseFocus(QWaylandView *view)
QWaylandTouch *touch() const

Signals

void cursorSurfaceRequest(QWaylandSurface *surface, int hotspotX, int hotspotY)
void keyboardFocusChanged(QWaylandSurface *newFocus, QWaylandSurface *oldFocus)
void mouseFocusChanged(QWaylandView *newFocus, QWaylandView *oldFocus)

Detailed Description

The QWaylandInputDevice class provides access to keyboard, mouse, and touch input.

The QWaylandInputDevice provides access to different types of user input and maintains a keyboard focus and a mouse pointer. It corresponds to the wl_seat interface in the Wayland protocol.

Member Type Documentation

enum QWaylandInputDevice::CapabilityFlag
flags QWaylandInputDevice::CapabilityFlags

This enum type describes the capabilities of a QWaylandInputDevice.

ConstantValueDescription
QWaylandInputDevice::Pointer0x01The QWaylandInputDevice supports pointer input.
QWaylandInputDevice::Keyboard0x02The QWaylandInputDevice supports keyboard input.
QWaylandInputDevice::Touch0x04The QWaylandInputDevice supports touch input.

The CapabilityFlags type is a typedef for QFlags<CapabilityFlag>. It stores an OR combination of CapabilityFlag values.

Member Function Documentation

QWaylandInputDevice::QWaylandInputDevice(QWaylandCompositor *compositor, CapabilityFlags capabilityFlags = DefaultCapabilities)

Constructs a QWaylandInputDevice for the given compositor and with the given capabilityFlags.

[virtual] QWaylandInputDevice::~QWaylandInputDevice()

Destroys the QWaylandInputDevice

QWaylandInputDevice::CapabilityFlags QWaylandInputDevice::capabilities() const

Returns the capability flags for this QWaylandInputDevice.

QWaylandCompositor *QWaylandInputDevice::compositor() const

Returns the compositor for this QWaylandInputDevice.

[signal] void QWaylandInputDevice::cursorSurfaceRequest(QWaylandSurface *surface, int hotspotX, int hotspotY)

QWaylandDrag *QWaylandInputDevice::drag() const

Returns the drag object for this QWaylandInputDevice.

QWaylandKeyboard *QWaylandInputDevice::keyboard() const

Returns the keyboard for this input device.

QWaylandSurface *QWaylandInputDevice::keyboardFocus() const

Returns the current focused surface for keyboard input.

See also setKeyboardFocus().

[signal] void QWaylandInputDevice::keyboardFocusChanged(QWaylandSurface *newFocus, QWaylandSurface *oldFocus)

QWaylandView *QWaylandInputDevice::mouseFocus() const

Returns the view that currently has mouse focus.

See also setMouseFocus().

[signal] void QWaylandInputDevice::mouseFocusChanged(QWaylandView *newFocus, QWaylandView *oldFocus)

This signal is emitted when the mouse focus has changed from oldFocus to newFocus.

QWaylandPointer *QWaylandInputDevice::pointer() const

Returns the pointer device for this QWaylandInputDevice.

void QWaylandInputDevice::sendFullKeyEvent(QKeyEvent *event)

Sends the event to the keyboard device.

void QWaylandInputDevice::sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event)

void QWaylandInputDevice::sendFullTouchEvent(QTouchEvent *event)

Sends the event to the touch device.

void QWaylandInputDevice::sendKeyPressEvent(uint code)

Sends a key press event with the key code to the keyboard device.

void QWaylandInputDevice::sendKeyReleaseEvent(uint code)

Sends a key release event with the key code to the keyboard device.

void QWaylandInputDevice::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos = QPointF())

Sets the mouse focus to view and sends a mouse move event to the pointer device with the local position localPos and output space position outputSpacePos.

void QWaylandInputDevice::sendMousePressEvent(Qt::MouseButton button)

Sends a mouse press event for button to the QWaylandInputDevice's pointer device.

void QWaylandInputDevice::sendMouseReleaseEvent(Qt::MouseButton button)

Sends a mouse release event for button to the QWaylandInputDevice's pointer device.

void QWaylandInputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta)

Sends a mouse wheel event to the QWaylandInputDevice's pointer device with the given orientation and delta.

void QWaylandInputDevice::sendTouchCancelEvent()

Sends a cancel event to the touch device.

void QWaylandInputDevice::sendTouchFrameEvent()

Sends a frame event to the touch device.

void QWaylandInputDevice::sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state)

Sends a touch point event with the given id and state to the touch device. The position of the touch point is given by point.

bool QWaylandInputDevice::setKeyboardFocus(QWaylandSurface *surface)

Sets the current keyboard focus to surface.

See also keyboardFocus().

void QWaylandInputDevice::setKeymap(const QWaylandKeymap &keymap)

Sets the key map of this QWaylandInputDevice to keymap.

void QWaylandInputDevice::setMouseFocus(QWaylandView *view)

Sets the current mouse focus to view.

See also mouseFocus().

QWaylandTouch *QWaylandInputDevice::touch() const

Returns the touch device for this QWaylandInputDevice.