QWaylandSeat Class

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

Header: #include <QWaylandSeat>
qmake: QT += waylandcompositor
Since: Qt 5.8
Inherits: QWaylandObject

Public Types

enum CapabilityFlag { Pointer, Keyboard, Touch }
flags CapabilityFlags

Properties

  • drag : QWaylandDrag * const
  • keymap : QWaylandKeymap * const
  • 1 property inherited from QObject

Public Functions

QWaylandSeat(QWaylandCompositor *compositor, CapabilityFlags capabilityFlags = DefaultCapabilities)
virtual ~QWaylandSeat()
QWaylandSeat::CapabilityFlags capabilities() const
QWaylandCompositor *compositor() const
QWaylandDrag *drag() const
virtual void initialize()
bool isInitialized() const
QWaylandKeyboard *keyboard() const
QWaylandSurface *keyboardFocus() const
QWaylandKeymap *keymap()
QWaylandView *mouseFocus() const
QWaylandPointer *pointer() const
void sendFullKeyEvent(QKeyEvent *event)
void sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event)
void sendFullTouchEvent(QWaylandSurface *surface, 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(QWaylandClient *client)
void sendTouchFrameEvent(QWaylandClient *client)
uint sendTouchPointEvent(QWaylandSurface *surface, int id, const QPointF &point, Qt::TouchPointState state)
bool setKeyboardFocus(QWaylandSurface *surface)
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)

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

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

The QWaylandSeat 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 QWaylandSeat::CapabilityFlag
flags QWaylandSeat::CapabilityFlags

This enum type describes the capabilities of a QWaylandSeat.

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

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

Property Documentation

drag : QWaylandDrag * const

Access functions:

QWaylandDrag *drag() const

keymap : QWaylandKeymap * const

Access functions:

QWaylandKeymap *keymap()

Member Function Documentation

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

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

[virtual] QWaylandSeat::~QWaylandSeat()

Destroys the QWaylandSeat

QWaylandSeat::CapabilityFlags QWaylandSeat::capabilities() const

Returns the capability flags for this QWaylandSeat.

QWaylandCompositor *QWaylandSeat::compositor() const

Returns the compositor for this QWaylandSeat.

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

QWaylandDrag *QWaylandSeat::drag() const

Returns the drag object for this QWaylandSeat.

Note: Getter function for property drag.

[virtual] void QWaylandSeat::initialize()

bool QWaylandSeat::isInitialized() const

QWaylandKeyboard *QWaylandSeat::keyboard() const

Returns the keyboard for this input device.

QWaylandSurface *QWaylandSeat::keyboardFocus() const

Returns the current focused surface for keyboard input.

See also setKeyboardFocus().

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

QWaylandView *QWaylandSeat::mouseFocus() const

Returns the view that currently has mouse focus.

See also setMouseFocus().

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

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

QWaylandPointer *QWaylandSeat::pointer() const

Returns the pointer device for this QWaylandSeat.

void QWaylandSeat::sendFullKeyEvent(QKeyEvent *event)

Sends the event to the keyboard device.

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

void QWaylandSeat::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *event)

Sends the event to the specified surface on the touch device.

void QWaylandSeat::sendKeyPressEvent(uint code)

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

void QWaylandSeat::sendKeyReleaseEvent(uint code)

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

void QWaylandSeat::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 QWaylandSeat::sendMousePressEvent(Qt::MouseButton button)

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

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

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

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

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

void QWaylandSeat::sendTouchCancelEvent(QWaylandClient *client)

Sends a cancel event to the touch device of a client.

void QWaylandSeat::sendTouchFrameEvent(QWaylandClient *client)

Sends a frame event to the touch device of a client.

uint QWaylandSeat::sendTouchPointEvent(QWaylandSurface *surface, int id, const QPointF &point, Qt::TouchPointState state)

Sends a touch point event to the surface on a touch device with the given id, point and state.

Returns the serial for the touch up or touch down event.

bool QWaylandSeat::setKeyboardFocus(QWaylandSurface *surface)

Sets the current keyboard focus to surface.

See also keyboardFocus().

void QWaylandSeat::setMouseFocus(QWaylandView *view)

Sets the current mouse focus to view.

See also mouseFocus().

QWaylandTouch *QWaylandSeat::touch() const

Returns the touch device for this QWaylandSeat.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.