pub struct KeyboardHandle { /* private fields */ }
Expand description

An handle to a keyboard handler

It can be cloned and all clones manipulate the same internal state. Clones can also be sent across threads.

This handle gives you 2 main ways to interact with the keyboard handling:

  • set the current focus for this keyboard: designing the surface that will receive the key inputs using the KeyboardHandle::set_focus method.
  • process key inputs from the input backend, allowing them to be caught at the compositor-level or forwarded to the client. See the documentation of the KeyboardHandle::input method for details.

Implementations§

Handle a keystroke

All keystrokes from the input backend should be fed in order to this method of the keyboard handler. It will internally track the state of the keymap.

The filter argument is expected to be a closure which will peek at the generated input as interpreted by the keymap before it is forwarded to the focused client. If this closure returns false, the input will not be sent to the client. This mechanism can be used to implement compositor-level key bindings for example.

The module wayland::seat::keysyms exposes definitions of all possible keysyms to be compared against. This includes non-character keysyms, such as XF86 special keys.

Set the current focus of this keyboard

If the new focus is different from the previous one, any previous focus will be sent a wl_keyboard::Event::Leave event, and if the new focus is not None, a wl_keyboard::Event::Enter event will be sent.

Check if given client currently has keyboard focus

Change the repeat info configured for this keyboard

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.