#[non_exhaustive]
pub enum Event {
Show 15 variants Enter { serial: u32, surface: WlSurface, }, Leave { serial: u32, surface: WlSurface, }, InputPanelState { state: WEnum<InputPanelVisibility>, x: i32, y: i32, width: i32, height: i32, }, PreeditString { text: String, commit: String, }, PreeditStyling { index: u32, length: u32, style: WEnum<PreeditStyle>, }, PreeditCursor { index: i32, }, CommitString { text: String, }, CursorPosition { index: i32, anchor: i32, }, DeleteSurroundingText { before_length: u32, after_length: u32, }, ModifiersMap { map: Vec<u8>, }, Keysym { time: u32, sym: u32, state: u32, modifiers: u32, }, Language { language: String, }, TextDirection { direction: WEnum<TextDirection>, }, ConfigureSurroundingText { before_cursor: i32, after_cursor: i32, }, InputMethodChanged { serial: u32, flags: u32, },
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Enter

enter event

Notification that this seat’s text-input focus is on a certain surface.

When the seat has the keyboard capability the text-input focus follows the keyboard focus.

Fields

§serial: u32

serial to be used by update_state

§surface: WlSurface
§

Leave

leave event

Notification that this seat’s text-input focus is no longer on a certain surface.

The leave notification is sent before the enter notification for the new focus.

When the seat has the keyboard capability the text-input focus follows the keyboard focus.

Fields

§serial: u32
§surface: WlSurface
§

InputPanelState

state of the input panel

Notification that the visibility of the input panel (virtual keyboard) changed.

The rectangle x, y, width, height defines the area overlapped by the input panel (virtual keyboard) on the surface having the text focus in surface local coordinates.

That can be used to make sure widgets are visible and not covered by a virtual keyboard.

Fields

§width: i32
§height: i32
§

PreeditString

pre-edit

Notify when a new composing text (pre-edit) should be set around the current cursor position. Any previously set composing text should be removed.

The commit text can be used to replace the composing text in some cases (for example when losing focus).

The text input should also handle all preedit_style and preedit_cursor events occurring directly before preedit_string.

Fields

§text: String
§commit: String
§

PreeditStyling

pre-edit styling

Sets styling information on composing text. The style is applied for length bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text by sending multiple preedit_styling events.

This event is handled as part of a following preedit_string event.

Fields

§index: u32
§length: u32
§

PreeditCursor

pre-edit cursor

Sets the cursor position inside the composing text (as byte offset) relative to the start of the composing text. When index is a negative number no cursor is shown.

When no preedit_cursor event is sent the cursor will be at the end of the composing text by default.

This event is handled as part of a following preedit_string event.

Fields

§index: i32
§

CommitString

commit

Notify when text should be inserted into the editor widget. The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could be also an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position).

Any previously set composing text should be removed.

Fields

§text: String
§

CursorPosition

set cursor to new position

Notify when the cursor or anchor position should be modified.

This event should be handled as part of a following commit_string event.

The text between anchor and index should be selected.

Fields

§index: i32

position of cursor

§anchor: i32

position of selection anchor

§

DeleteSurroundingText

delete surrounding text

Notify when the text around the current cursor position should be deleted. BeforeLength and afterLength is the length (in bytes) of text before and after the current cursor position (excluding the selection) to delete.

This event should be handled as part of a following commit_string or preedit_string event.

Fields

§before_length: u32

length of text before current cursor position

§after_length: u32

length of text after current cursor position

§

ModifiersMap

modifiers map

Transfer an array of 0-terminated modifiers names. The position in the array is the index of the modifier as used in the modifiers bitmask in the keysym event.

Fields

§map: Vec<u8>
§

Keysym

keysym

Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounding_text, etc. The key event follows the wl_keyboard key event convention. Sym is a XKB keysym, state a wl_keyboard key_state. Modifiers are a mask for effective modifiers (where the modifier indices are set by the modifiers_map event)

Fields

§time: u32
§sym: u32
§state: u32
§modifiers: u32
§

Language

language

Sets the language of the input text. The “language” argument is a RFC-3066 format language tag.

Fields

§language: String
§

TextDirection

text direction

Sets the text direction of input text.

It is mainly needed for showing input cursor on correct side of the editor when there is no input yet done and making sure neutral direction text is laid out properly.

Fields

§

ConfigureSurroundingText

configure amount of surrounding text to be sent

Configure what amount of surrounding text is expected by the input method. The surrounding text will be sent in the set_surrounding_text request on the following state information updates.

Fields

§before_cursor: i32
§after_cursor: i32
§

InputMethodChanged

Notifies about a changed input method

The input method changed on compositor side, which invalidates all current state information. New state information should be sent from the client via state requests (set_surrounding_text, set_content_hint, …) and update_state.

Fields

§serial: u32

serial to be used by update_state

§flags: u32

currently unused

Implementations§

source§

impl Event

source

pub fn opcode(&self) -> u16

Get the opcode number of this message

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl !RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl !UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.