struct Worker {
context: Context,
converter: EiEventConverter,
devices: Vec<Device>,
last_serial: u32,
mod_refs: HashMap<u32, u32>,
pressed: HashMap<u32, (u32, Vec<u32>)>,
}Fields§
§context: Context§converter: EiEventConverter§devices: Vec<Device>§last_serial: u32§mod_refs: HashMap<u32, u32>Held modifier evdev keycodes and their press count, so a key that synthesized a modifier releases exactly what it added.
pressed: HashMap<u32, (u32, Vec<u32>)>Per xkb keycode, the evdev key and synthesized modifiers its press emitted, replayed on release so a mid-stream keymap read cannot desync it.
Implementations§
Source§impl Worker
impl Worker
fn run( context: Context, wake_rd: OwnedFd, queue: Arc<Mutex<Vec<Cmd>>>, alive: Arc<AtomicBool>, ready: Arc<(Mutex<Option<Result<(), String>>>, Condvar)>, )
fn signal( ready: &Arc<(Mutex<Option<Result<(), String>>>, Condvar)>, result: Result<(), String>, )
fn has(&self, f: impl Fn(&Device) -> bool) -> bool
Sourcefn poll(&self, wake_fd: i32, timeout: i32) -> bool
fn poll(&self, wake_fd: i32, timeout: i32) -> bool
Block until the socket or the wake pipe is readable (or timeout ms elapses, -1 for no
limit); false on a poll error that should end the session.
Sourcefn pump_socket(&mut self) -> Result<(), ()>
fn pump_socket(&mut self) -> Result<(), ()>
Read and dispatch whatever the server sent; Err on a closed or broken socket.
fn handle(&mut self, event: EiEvent)
fn find_mut(&mut self, device: &Device) -> Option<&mut Device>
fn drain(&mut self, queue: &Arc<Mutex<Vec<Cmd>>>)
fn emit(&mut self, cmd: Cmd)
fn emit_key(&mut self, xkb_keycode: u32, keysym: Option<u32>, pressed: bool)
Sourcefn resolve_key(
&self,
index: usize,
xkb_keycode: u32,
keysym: Option<u32>,
) -> (u32, Vec<u32>)
fn resolve_key( &self, index: usize, xkb_keycode: u32, keysym: Option<u32>, ) -> (u32, Vec<u32>)
The evdev keycode and modifier evdev keycodes to press this key with: its base keysym placed in the compositor’s own keymap where that keymap carries it, else the raw keycode.
Sourcefn ready_index(&self, want: impl Fn(&Device) -> bool) -> Option<usize>
fn ready_index(&self, want: impl Fn(&Device) -> bool) -> Option<usize>
The lowest-indexed resumed device matching want.
fn start(&mut self, index: usize)
fn frame(&mut self, index: usize)
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !Send for Worker
impl !Sync for Worker
impl !UnwindSafe for Worker
impl Freeze for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
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>
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)
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)
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more