Skip to main content

XxKeyboardFilterManagerV1

Struct XxKeyboardFilterManagerV1 

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

xx_keyboard_filter_manager_v1

This interface has no events.

Implementations§

§

impl XxKeyboardFilterManagerV1

pub fn bind_to_input_method<U, D>( &self, keyboard: &WlKeyboard, input_method: &XxInputMethodV1, surface: &WlSurface, qh: &QueueHandle<D>, udata: U, ) -> XxKeyboardFilterV1
where U: Send + Sync + 'static, D: Dispatch<XxKeyboardFilterV1, U> + 'static,

Bind a keyboard to an input method

Bind a keyboard to an input method for the purpose of capturing key presses before they reach the text input client.

When a wl_keyboard is bound, the compositor must redirect to it the input events intended for the focused surface with text input enabled. The wl_keyboard instance receives no other events from then on. See keyboard_filter.filter.

For the bound wl_keyboard instance to intercept events, the following conditions must be fulfilled:

  • there’s a focused surface,
  • the surface has an enabled text input object,
  • the bound input method is active (for the meaning of “active”, see input_method.activate, input_method.deactivate).

When those conditions are fulfilled, the compositor must start redirecting input events intended for the text input surface to the wl_keyboard bound with this request. Otherwise, the text input surface receives events without intercepting them.

Be aware that the text input client might use a wl_keyboard object(s) of different version(s) than the one used by the input method. The compositor should issue events as it would normally do for the versions in question. This protocol assumes that events to multiple keyboards of different protocol versions are equivalent.

Background:

Whenever the input method is activated, the compositor must start sending it keyboard events intended for the text-input client, so that the input method can be controlled using a keyboard. Traditionally, from the user perspective, input methods receive keys as if they were an overlay: keys which are interesting to the input method gain a special input method meaning, all others work as usual. The binding and the keyboard_filter.filter request together make this possible by letting the input method indicate which events it is interested in.

Conceptually, when a wl_keyboard is bound to an input_method, the compositor prevents all keyboard events directed to the text input client from reaching it. They are delayed until the input method decides how to filter them using the keyboard_filter.filter request.

Arguments:

The wl_keyboard must not be already bound to another interface. The wl_keyboard must only receive events between committed .activate and .deactivate.

The surface argument represents an arbitrary wl_surface. When issuing wl_keyboard.enter and wl_keyboard.leave on the bound wl_keyboard, the compositor must replace the original surface argument with the one provided by the input method in this request.

Because the wl_keyboard.enter and wl_keyboard.leave events require a surface as the target, one must be provided even if the input method doesn’t display one. A dummy one is sufficient. The provided wl_surface will not be used for any other purpose than explained above.

The surface must outlive the input method.

NOTE: This feature works much better with compositor-side key repeat introduced in wl_seat version 10. This protocol doesn’t provide controls for filtering repeat key events generated client-side. A compositor implementing this protocol should implement compositor-side key repeat.

This request takes effect immediately.

Attempting to bind a keyboard to an input method which is already bound must cause the already_bound error. Attempting to bind a keyboard object which was already bound must cause the already_bound error. Attempting to bind a keyboard object to an input method acting on a different seat must cause the wrong_seat error.

When the input method gets destroyed, the compositor must stop issuing events to the keyboard and ignore any further requests to keyboard_filter, except keyboard_filter.destroy.

pub fn destroy(&self)

destroy the input method manager

Destroys the xx_keyboard_filter_manager_v1 object.

The xx_keyboard_filter_v1 objects originating from it remain unaffected.

Trait Implementations§

§

impl Borrow<ObjectId> for XxKeyboardFilterManagerV1

§

fn borrow(&self) -> &ObjectId

Immutably borrows from an owned value. Read more
§

impl Clone for XxKeyboardFilterManagerV1

§

fn clone(&self) -> XxKeyboardFilterManagerV1

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for XxKeyboardFilterManagerV1

§

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

Formats the value using the given formatter. Read more
Source§

impl<D> Dispatch2<XxKeyboardFilterManagerV1, D> for GlobalData

Source§

fn event( &self, _data: &mut D, _manager: &XxKeyboardFilterManagerV1, _event: Event, _conn: &Connection, _qh: &QueueHandle<D>, )

Source§

fn event_created_child( opcode: u16, _qh: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

§

impl Hash for XxKeyboardFilterManagerV1

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq<Weak<XxKeyboardFilterManagerV1>> for XxKeyboardFilterManagerV1

§

fn eq(&self, other: &Weak<XxKeyboardFilterManagerV1>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq for XxKeyboardFilterManagerV1

§

fn eq(&self, other: &XxKeyboardFilterManagerV1) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Proxy for XxKeyboardFilterManagerV1

§

type Request<'request> = Request<'request>

The request enum for this interface
§

type Event = Event

The event enum for this interface
§

fn interface() -> &'static Interface

The interface description
§

fn id(&self) -> ObjectId

The ID of this object
§

fn version(&self) -> u32

The version of this object
§

fn data<U>(&self) -> Option<&U>
where U: Send + Sync + 'static,

Access the user-data associated with this object
§

fn object_data(&self) -> Option<&Arc<dyn ObjectData>>

Access the raw data associated with this object. Read more
§

fn backend(&self) -> &WeakBackend

Access the backend associated with this object
§

fn send_request( &self, req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>

Send a request for this object. Read more
§

fn send_constructor<I>( &self, req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
where I: Proxy,

Send a request for this object that creates another object. Read more
§

fn from_id( conn: &Connection, id: ObjectId, ) -> Result<XxKeyboardFilterManagerV1, InvalidId>

Create an object proxy from its ID Read more
§

fn inert(backend: WeakBackend) -> XxKeyboardFilterManagerV1

Create an inert object proxy Read more
§

fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(XxKeyboardFilterManagerV1, <XxKeyboardFilterManagerV1 as Proxy>::Event), DispatchError>

Parse a event for this object Read more
§

fn write_request<'a>( &self, conn: &Connection, msg: <XxKeyboardFilterManagerV1 as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>

Serialize a request for this object Read more
§

fn is_alive(&self) -> bool

Checks if the Wayland object associated with this proxy is still alive
§

fn downgrade(&self) -> Weak<Self>

Creates a weak handle to this object Read more
§

impl Eq for XxKeyboardFilterManagerV1

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

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

§

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.
§

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.
§

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.
§

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.
§

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

§

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more