Struct XxKeyboardFilterManagerV1
pub struct XxKeyboardFilterManagerV1 { /* private fields */ }Expand description
xx_keyboard_filter_manager_v1
This interface has no events.
Implementations§
§impl XxKeyboardFilterManagerV1
impl XxKeyboardFilterManagerV1
pub fn bind_to_input_method<U, D>(
&self,
keyboard: &WlKeyboard,
input_method: &XxInputMethodV1,
surface: &WlSurface,
qh: &QueueHandle<D>,
udata: U,
) -> XxKeyboardFilterV1
pub fn bind_to_input_method<U, D>( &self, keyboard: &WlKeyboard, input_method: &XxInputMethodV1, surface: &WlSurface, qh: &QueueHandle<D>, udata: U, ) -> XxKeyboardFilterV1
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)
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
impl Borrow<ObjectId> for XxKeyboardFilterManagerV1
§impl Clone for XxKeyboardFilterManagerV1
impl Clone for XxKeyboardFilterManagerV1
§fn clone(&self) -> XxKeyboardFilterManagerV1
fn clone(&self) -> XxKeyboardFilterManagerV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for XxKeyboardFilterManagerV1
impl Debug for XxKeyboardFilterManagerV1
Source§impl<D> Dispatch2<XxKeyboardFilterManagerV1, D> for GlobalData
impl<D> Dispatch2<XxKeyboardFilterManagerV1, D> for GlobalData
fn event( &self, _data: &mut D, _manager: &XxKeyboardFilterManagerV1, _event: Event, _conn: &Connection, _qh: &QueueHandle<D>, )
fn event_created_child( opcode: u16, _qh: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
§impl Hash for XxKeyboardFilterManagerV1
impl Hash for XxKeyboardFilterManagerV1
§impl PartialEq<Weak<XxKeyboardFilterManagerV1>> for XxKeyboardFilterManagerV1
impl PartialEq<Weak<XxKeyboardFilterManagerV1>> for XxKeyboardFilterManagerV1
§impl PartialEq for XxKeyboardFilterManagerV1
impl PartialEq for XxKeyboardFilterManagerV1
§impl Proxy for XxKeyboardFilterManagerV1
impl Proxy for XxKeyboardFilterManagerV1
§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
§fn send_request(
&self,
req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>,
) -> Result<(), InvalidId>
fn send_request( &self, req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>, ) -> Result<(), InvalidId>
§fn send_constructor<I>(
&self,
req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
fn send_constructor<I>(
&self,
req: <XxKeyboardFilterManagerV1 as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
§fn from_id(
conn: &Connection,
id: ObjectId,
) -> Result<XxKeyboardFilterManagerV1, InvalidId>
fn from_id( conn: &Connection, id: ObjectId, ) -> Result<XxKeyboardFilterManagerV1, InvalidId>
§fn inert(backend: WeakBackend) -> XxKeyboardFilterManagerV1
fn inert(backend: WeakBackend) -> XxKeyboardFilterManagerV1
§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(XxKeyboardFilterManagerV1, <XxKeyboardFilterManagerV1 as Proxy>::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(XxKeyboardFilterManagerV1, <XxKeyboardFilterManagerV1 as Proxy>::Event), DispatchError>
§fn write_request<'a>(
&self,
conn: &Connection,
msg: <XxKeyboardFilterManagerV1 as Proxy>::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: <XxKeyboardFilterManagerV1 as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for XxKeyboardFilterManagerV1
Auto Trait Implementations§
impl Freeze for XxKeyboardFilterManagerV1
impl !RefUnwindSafe for XxKeyboardFilterManagerV1
impl Send for XxKeyboardFilterManagerV1
impl Sync for XxKeyboardFilterManagerV1
impl Unpin for XxKeyboardFilterManagerV1
impl UnsafeUnpin for XxKeyboardFilterManagerV1
impl !UnwindSafe for XxKeyboardFilterManagerV1
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.