pub trait KeyboardTarget<D>:
IsAlive
+ PartialEq
+ Clone
+ Debug
+ Sendwhere
D: SeatHandler,{
// Required methods
fn enter(
&self,
seat: &Seat<D>,
data: &mut D,
keys: Vec<KeysymHandle<'_>>,
serial: Serial,
);
fn leave(&self, seat: &Seat<D>, data: &mut D, serial: Serial);
fn key(
&self,
seat: &Seat<D>,
data: &mut D,
key: KeysymHandle<'_>,
state: KeyState,
serial: Serial,
time: u32,
);
fn modifiers(
&self,
seat: &Seat<D>,
data: &mut D,
modifiers: ModifiersState,
serial: Serial,
);
// Provided method
fn replace(
&self,
replaced: <D as SeatHandler>::KeyboardFocus,
seat: &Seat<D>,
data: &mut D,
keys: Vec<KeysymHandle<'_>>,
modifiers: ModifiersState,
serial: Serial,
) { ... }
}Expand description
Trait representing object that can receive keyboard interactions
Required Methods§
Sourcefn enter(
&self,
seat: &Seat<D>,
data: &mut D,
keys: Vec<KeysymHandle<'_>>,
serial: Serial,
)
fn enter( &self, seat: &Seat<D>, data: &mut D, keys: Vec<KeysymHandle<'_>>, serial: Serial, )
Keyboard focus of a given seat was assigned to this handler
Sourcefn leave(&self, seat: &Seat<D>, data: &mut D, serial: Serial)
fn leave(&self, seat: &Seat<D>, data: &mut D, serial: Serial)
The keyboard focus of a given seat left this handler
Provided Methods§
Sourcefn replace(
&self,
replaced: <D as SeatHandler>::KeyboardFocus,
seat: &Seat<D>,
data: &mut D,
keys: Vec<KeysymHandle<'_>>,
modifiers: ModifiersState,
serial: Serial,
)
fn replace( &self, replaced: <D as SeatHandler>::KeyboardFocus, seat: &Seat<D>, data: &mut D, keys: Vec<KeysymHandle<'_>>, modifiers: ModifiersState, serial: Serial, )
Keyboard focus of a given seat moved from another handler to this handler
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<D: SeatHandler + 'static> KeyboardTarget<D> for WlSurface
Available on crate feature wayland_frontend only.
impl<D: SeatHandler + 'static> KeyboardTarget<D> for WlSurface
Available on crate feature
wayland_frontend only.fn enter( &self, seat: &Seat<D>, state: &mut D, keys: Vec<KeysymHandle<'_>>, serial: Serial, )
fn leave(&self, seat: &Seat<D>, state: &mut D, serial: Serial)
fn key( &self, seat: &Seat<D>, _data: &mut D, key: KeysymHandle<'_>, state: KeyState, serial: Serial, time: u32, )
fn modifiers( &self, seat: &Seat<D>, _data: &mut D, modifiers: ModifiersState, serial: Serial, )
Implementors§
impl<D: SeatHandler + 'static> KeyboardTarget<D> for X11Surface
Available on crate feature
xwayland only.