pub struct Processor<T: EventListener, A: ActionContext<T>> {
pub ctx: A,
_phantom: PhantomData<T>,
}
Expand description
Processes input from winit.
An escape sequence may be emitted in case specific keys or key combinations are activated.
Fields§
§ctx: A
§_phantom: PhantomData<T>
Implementations§
source§impl Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>>
impl Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>>
sourcepub fn handle_event(&mut self, event: WinitEvent<Event>)
pub fn handle_event(&mut self, event: WinitEvent<Event>)
Handle events from winit.
source§impl<T: EventListener, A: ActionContext<T>> Processor<T, A>
impl<T: EventListener, A: ActionContext<T>> Processor<T, A>
fn alt_send_esc(&mut self, key: &KeyEvent, text: &str) -> bool
sourcefn should_build_sequence(
key: &KeyEvent,
text: &str,
mode: TermMode,
mods: ModifiersState
) -> bool
fn should_build_sequence( key: &KeyEvent, text: &str, mode: TermMode, mods: ModifiersState ) -> bool
Check whether we should try to build escape sequence for the KeyEvent
.
sourcefn process_key_bindings(&mut self, key: &KeyEvent) -> bool
fn process_key_bindings(&mut self, key: &KeyEvent) -> bool
Attempt to find a binding and execute its action.
The provided mode, mods, and key must match what is allowed by a binding for its action to be executed.
sourcefn key_release(&mut self, key: KeyEvent, mode: TermMode, mods: ModifiersState)
fn key_release(&mut self, key: KeyEvent, mode: TermMode, mods: ModifiersState)
Handle key release.
sourcefn reset_search_delay(&mut self)
fn reset_search_delay(&mut self)
Reset search delay.
source§impl<T: EventListener, A: ActionContext<T>> Processor<T, A>
impl<T: EventListener, A: ActionContext<T>> Processor<T, A>
pub fn new(ctx: A) -> Self
pub fn mouse_moved(&mut self, position: PhysicalPosition<f64>)
fn mouse_report(&mut self, button: u8, state: ElementState)
fn normal_mouse_report(&mut self, point: Point, button: u8)
fn sgr_mouse_report(&mut self, point: Point, button: u8, state: ElementState)
fn on_mouse_press(&mut self, button: MouseButton)
sourcefn on_left_click(&mut self, point: Point)
fn on_left_click(&mut self, point: Point)
Handle left click selection and vi mode cursor movement.
fn on_mouse_release(&mut self, button: MouseButton)
pub fn mouse_wheel_input(&mut self, delta: MouseScrollDelta, phase: TouchPhase)
fn scroll_terminal( &mut self, new_scroll_x_px: f64, new_scroll_y_px: f64, multiplier: f64 )
pub fn on_focus_change(&mut self, is_focused: bool)
sourcepub fn touch(&mut self, touch: TouchEvent)
pub fn touch(&mut self, touch: TouchEvent)
Handle touch input.
sourcepub fn on_touch_start(&mut self, touch: TouchEvent)
pub fn on_touch_start(&mut self, touch: TouchEvent)
Handle beginning of touch input.
sourcepub fn on_touch_motion(&mut self, touch: TouchEvent)
pub fn on_touch_motion(&mut self, touch: TouchEvent)
Handle touch input movement.
sourcepub fn on_touch_end(&mut self, touch: TouchEvent)
pub fn on_touch_end(&mut self, touch: TouchEvent)
Handle end of touch input.
sourcepub fn reset_mouse_cursor(&mut self)
pub fn reset_mouse_cursor(&mut self)
Reset mouse cursor based on modifier and terminal state.
sourcepub fn modifiers_input(&mut self, modifiers: Modifiers)
pub fn modifiers_input(&mut self, modifiers: Modifiers)
Modifier state change.
pub fn mouse_input(&mut self, state: ElementState, button: MouseButton)
sourcefn process_mouse_bindings(&mut self, button: MouseButton)
fn process_mouse_bindings(&mut self, button: MouseButton)
Attempt to find a binding and execute its action.
The provided mode, mods, and key must match what is allowed by a binding for its action to be executed.
sourcefn message_bar_cursor_state(&self) -> Option<CursorIcon>
fn message_bar_cursor_state(&self) -> Option<CursorIcon>
Check mouse icon state in relation to the message bar.
sourcefn cursor_state(&mut self) -> CursorIcon
fn cursor_state(&mut self) -> CursorIcon
Icon state of the cursor.
sourcefn update_selection_scrolling(&mut self, mouse_y: i32)
fn update_selection_scrolling(&mut self, mouse_y: i32)
Handle automatic scrolling when selecting above/below the window.
Auto Trait Implementations§
impl<T, A> RefUnwindSafe for Processor<T, A>where A: RefUnwindSafe, T: RefUnwindSafe,
impl<T, A> Send for Processor<T, A>where A: Send, T: Send,
impl<T, A> Sync for Processor<T, A>where A: Sync, T: Sync,
impl<T, A> Unpin for Processor<T, A>where A: Unpin, T: Unpin,
impl<T, A> UnwindSafe for Processor<T, A>where A: UnwindSafe, T: UnwindSafe,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§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
.source§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
.source§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.source§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.