- Qt 6.8
- Qt Wayland Compositor
- QML Types
- WaylandSeat
- Qt Wayland Compositor | Commercial or GPLv3

# WaylandSeat QML Type

Provides access to keyboard, mouse, and touch input. More...

Import Statement: | import QtWayland.Compositor
Instantiates: | QWaylandSeat

- List of all members, including inherited members

## Signals

- void cursorSurfaceRequest(QWaylandSurface surface, int hotspotX, int hotspotY)
- void keyboardFocusChanged(QWaylandSurface newFocus, QWaylandSurface oldFocus)

## Methods

- void sendKeyEvent(int qtKey, bool pressed)
- void sendTouchCancelEvent(WaylandClient client)
- void sendTouchFrameEvent(WaylandClient client)
- void sendTouchPointMoved(WaylandSurface surface, int id, point position)
- uint sendTouchPointPressed(WaylandSurface surface, int id, point position)
- void sendTouchPointReleased(WaylandSurface surface, int id, point position)
- void sendUnicodeKeyPressEvent(uint unicode) `(since 6.7)`
- void sendUnicodeKeyReleaseEvent(uint unicode) `(since 6.7)`

## Detailed Description

The WaylandSeat type 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.

## Signal Documentation

void cursorSurfaceRequest(QWaylandSurface surface, int hotspotX, int hotspotY)

This signal is emitted when the client has requested for a specific surface to be the mouse cursor. For example, when the user hovers over a particular surface, and you want the cursor to change into a resize arrow.

Both hotspotX and hotspotY are offsets from the top-left of a pointer surface, where a click should happen. For example, if the requested cursor surface is an arrow, the parameters indicate where the arrow's tip is, on that surface.

Note: The corresponding handler is `onCursorSurfaceRequest`.

void keyboardFocusChanged(QWaylandSurface newFocus, QWaylandSurface oldFocus)

This signal is emitted when setKeyboardFocus() is called or when a WaylandQuickItem has focus and the user starts pressing keys.

newFocus has the surface that received keyboard focus; or `nullptr` if no surface has focus. oldFocus has the surface that lost keyboard focus; or `nullptr` if no surface had focus.

Note: The corresponding handler is `onKeyboardFocusChanged`.

## Method Documentation

void sendKeyEvent(int qtKey, bool pressed)

Sends a key press (if pressed is `true`) or release (if pressed is `false`) event of a key qtKey to the keyboard device.

void sendTouchCancelEvent(WaylandClient client)

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

void sendTouchFrameEvent(WaylandClient client)

Sends a frame event to the touch device of a client to indicate the end of a series of touch up, down, and motion events.

void sendTouchPointMoved(WaylandSurface surface, int id, point position)

Sends a touch moved event for the touch point id on surface with position position.

Note: You need to send a touch frame event when you are done sending touch events.

Warning: This API should not be used in combination with forwarding of touch events using WaylandQuickItem::touchEventsEnabled, as it might lead to conflicting touch ids.

Returns the serial for the touch motion event.

uint sendTouchPointPressed(WaylandSurface surface, int id, point position)

Sends a touch pressed event for the touch point id on surface with position position.

Note: You need to send a touch frame event when you are done sending touch events.

Warning: This API should not be used in combination with forwarding of touch events using WaylandQuickItem::touchEventsEnabled, as it might lead to conflicting touch ids.

Returns the serial for the touch down event.

void sendTouchPointReleased(WaylandSurface surface, int id, point position)

Sends a touch released event for the touch point id on surface with position position.

Note: You need to send a touch frame event when you are done sending touch events.

Warning: This API should not be used in combination with forwarding of touch events using WaylandQuickItem::touchEventsEnabled, as it might lead to conflicting touch ids.

Returns the serial for the touch up event.

`[since 6.7]` void sendUnicodeKeyPressEvent(uint unicode)

Sends a key press event of a UCS4 unicode through a text-input protocol.

Note: This function will not work properly if the client does not support the text-input protocol that the compositor supports.

This method was introduced in Qt 6.7.

`[since 6.7]` void sendUnicodeKeyReleaseEvent(uint unicode)

Sends a key release event of a UCS4 unicode through a text-input protocol.

Note: This function will not work properly if the client does not support the text-input protocol that the compositor supports.

This method was introduced in Qt 6.7.