Module smithay::wayland::seat

source ·
Expand description

Seat global utilities

This module provides you with utilities for handling the seat globals and the associated input Wayland objects.

How to use it

Initialization

use smithay::wayland::seat::{Seat, CursorImageRole};

// You need to insert the `CursorImageRole` into your roles, to handle requests from clients
// to set a surface as a cursor image
define_roles!(Roles => [CursorImage, CursorImageRole]);

// insert the seat:
let (seat, seat_global) = Seat::new(
    &mut display,             // the display
    "seat-0".into(),          // the name of the seat, will be advertized to clients
    compositor_token.clone(), // the compositor token
    None                      // insert a logger here
);

Run usage

Once the seat is initialized, you can add capabilities to it.

Currently, only pointer and keyboard capabilities are supported by smithay.

You can add these capabilities via methods of the Seat struct: add_keyboard, add_pointer. These methods return handles that can be cloned and sent across thread, so you can keep one around in your event-handling code to forward inputs to your clients.

Modules

Structs

A frame of pointer axis events.
The role representing a surface set as the pointer cursor
An handle to a keyboard handler
Represents the current state of the keyboard modifiers
An handle to a pointer handler
This inner handle is accessed from inside a pointer grab logic, and directly sends event to the client
A Seat handle
Configuration for xkbcommon.

Enums

Possible status of a cursor as requested by clients
Errors that can be encountered when creating a keyboard handler

Traits

A trait to implement a pointer grab

Type Definitions

A number used to represent the symbols generated from a key on a keyboard.