pub struct EventHandler { /* private fields */ }Expand description
Handles crossterm event reading and dispatches AppEvents.
Implementations§
Source§impl EventHandler
impl EventHandler
Sourcepub fn sender(&self) -> UnboundedSender<AppEvent>
pub fn sender(&self) -> UnboundedSender<AppEvent>
Get a clone of the sender for external event producers (agent, tools).
Sourcepub fn start(&self)
pub fn start(&self)
Start the crossterm event reader loop.
Uses crossterm’s async EventStream for zero-latency event delivery.
Includes a debounce state machine that distinguishes touchpad/mouse scroll
(rapid-fire Up/Down arrows via xterm alternate scroll mode \x1b[?1007h)
from keyboard arrow presses. Touchpad scroll generates arrows every 8-16ms
in bursts; keyboard presses are single events with ~300ms before repeat.
A 25ms debounce window cleanly separates these two input sources.
Also handles mouse events (click/drag/up for selection, scroll for terminals that support mouse reporting) and FocusGained for triggering redraws.
Auto Trait Implementations§
impl Freeze for EventHandler
impl RefUnwindSafe for EventHandler
impl Send for EventHandler
impl Sync for EventHandler
impl Unpin for EventHandler
impl UnsafeUnpin for EventHandler
impl UnwindSafe for EventHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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