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
impl XxKeyboardFilterV1
pub fn unbind(&self)
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)
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)
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
impl Borrow<ObjectId> for XxKeyboardFilterV1
§impl Clone for XxKeyboardFilterV1
impl Clone for XxKeyboardFilterV1
§fn clone(&self) -> XxKeyboardFilterV1
fn clone(&self) -> XxKeyboardFilterV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for XxKeyboardFilterV1
impl Debug for XxKeyboardFilterV1
Source§impl<D> Dispatch2<XxKeyboardFilterV1, D> for GlobalData
impl<D> Dispatch2<XxKeyboardFilterV1, D> for GlobalData
fn event( &self, _data: &mut D, _keyboard: &XxKeyboardFilterV1, _event: Event, _conn: &Connection, _qh: &QueueHandle<D>, )
fn event_created_child( opcode: u16, _qh: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
§impl Hash for XxKeyboardFilterV1
impl Hash for XxKeyboardFilterV1
§impl PartialEq<Weak<XxKeyboardFilterV1>> for XxKeyboardFilterV1
impl PartialEq<Weak<XxKeyboardFilterV1>> for XxKeyboardFilterV1
§impl PartialEq for XxKeyboardFilterV1
impl PartialEq for XxKeyboardFilterV1
§impl Proxy for XxKeyboardFilterV1
impl Proxy for XxKeyboardFilterV1
§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
§fn send_request(
&self,
req: <XxKeyboardFilterV1 as Proxy>::Request<'_>,
) -> Result<(), InvalidId>
fn send_request( &self, req: <XxKeyboardFilterV1 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>
§fn send_constructor<I>(
&self,
req: <XxKeyboardFilterV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
fn send_constructor<I>(
&self,
req: <XxKeyboardFilterV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
§fn from_id(
conn: &Connection,
id: ObjectId,
) -> Result<XxKeyboardFilterV1, InvalidId>
fn from_id( conn: &Connection, id: ObjectId, ) -> Result<XxKeyboardFilterV1, InvalidId>
§fn inert(backend: WeakBackend) -> XxKeyboardFilterV1
fn inert(backend: WeakBackend) -> XxKeyboardFilterV1
§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(XxKeyboardFilterV1, <XxKeyboardFilterV1 as Proxy>::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(XxKeyboardFilterV1, <XxKeyboardFilterV1 as Proxy>::Event), DispatchError>
§fn write_request<'a>(
&self,
conn: &Connection,
msg: <XxKeyboardFilterV1 as Proxy>::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: <XxKeyboardFilterV1 as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for XxKeyboardFilterV1
Auto Trait Implementations§
impl Freeze for XxKeyboardFilterV1
impl !RefUnwindSafe for XxKeyboardFilterV1
impl Send for XxKeyboardFilterV1
impl Sync for XxKeyboardFilterV1
impl Unpin for XxKeyboardFilterV1
impl UnsafeUnpin for XxKeyboardFilterV1
impl !UnwindSafe for XxKeyboardFilterV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.