Skip to main content

XxKeyboardFilterV1

Struct XxKeyboardFilterV1 

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

keyboard event filtering functionality

Manages the filtering of key presses.

This interface has no events.

Implementations§

§

impl XxKeyboardFilterV1

pub fn unbind(&self)

Stop intercepting

Unbind the keyboard and stop intercepting events.

Unbinds the bound keyboard and the input method. the compositor must stop redirecting keyboard events. Events that the keyboard_filter client has not yet responded to are treated as if they received the “passthrough” action.

This request takes effect immediately.

pub fn filter(&self, serial: u32, action: FilterAction)

decide the processing of a keyboard event

This request controls the filtering of keyboard input events before reaching the focused surface.

Usage:

While keyboard_filter is intercepting, the compositor must send every intercepted event to its bound wl_keyboard, and hold a copy of it in an internal queue. When the client responds with the .filter request, the compositor either removes the event from the queue (filter_action.consume), or sends the copy to the original wl_keyboard objects (filter_action.passthrough).

The compositor must process .filter the oldest event in the queue before processing more recent ones. For this reason, the client sets the argument “serial” to the serial of the corresponding event it received.

Exceptions:

If the event is other than wl_keyboard.key or contains no serial, it cannot be filtered. The keyboard_filter client must not respond to it with .filter request. When such an event is oldest in the queue, the compositor must proceed as if the event had received a “passthrough” reply.

As of wl_keyboard v10 and keyboard_filter_v1, the only event that can be filtered is the wl_keyboard.key event.

Sequence:

The wl_keyboard begins to receive events after input_method.activate is committed. The valid serial is the serial of the oldest wl_keyboard event which has been sent after input_method.activate but which hasn’t yet received a .filter confirmation. The compositor may raise the invalid_serial error in response to events with serials it had not issued. The compositor must ignore events with all other serials. (Particularly, this means events with repeating serials are accepted normally and are not ignored). Events must be filtered in order of arrival.

pub fn destroy(&self)

destroy the keyboard

Destroys the keyboard_filter object, stops event interception, and unbinds the wl_keyboard and input_method objects bound to it.

Trait Implementations§

§

impl Borrow<ObjectId> for XxKeyboardFilterV1

§

fn borrow(&self) -> &ObjectId

Immutably borrows from an owned value. Read more
§

impl Clone for XxKeyboardFilterV1

§

fn clone(&self) -> XxKeyboardFilterV1

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 XxKeyboardFilterV1

§

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

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

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

Source§

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

Source§

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

§

impl Hash for XxKeyboardFilterV1

§

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<XxKeyboardFilterV1>> for XxKeyboardFilterV1

§

fn eq(&self, other: &Weak<XxKeyboardFilterV1>) -> 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 XxKeyboardFilterV1

§

fn eq(&self, other: &XxKeyboardFilterV1) -> 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 XxKeyboardFilterV1

§

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: <XxKeyboardFilterV1 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>

Send a request for this object. Read more
§

fn send_constructor<I>( &self, req: <XxKeyboardFilterV1 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<XxKeyboardFilterV1, InvalidId>

Create an object proxy from its ID Read more
§

fn inert(backend: WeakBackend) -> XxKeyboardFilterV1

Create an inert object proxy Read more
§

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

Parse a event for this object Read more
§

fn write_request<'a>( &self, conn: &Connection, msg: <XxKeyboardFilterV1 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 XxKeyboardFilterV1

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