pub struct EditorEventHandler {
pub key_handler: KeyEventHandler,
}Expand description
Handles key and mouse events.
Fields§
§key_handler: KeyEventHandlerImplementations§
Source§impl EditorEventHandler
impl EditorEventHandler
Sourcepub fn new(key_handler: KeyEventHandler) -> Self
pub fn new(key_handler: KeyEventHandler) -> Self
Creates a new EditorEvent handler with the given key handler.
Sourcepub fn emacs_mode() -> Self
pub fn emacs_mode() -> Self
Creates a new EditorEvent handler with emacs-style keybindings.
Sourcepub fn on_event<T>(&mut self, event: T, state: &mut EditorState)
pub fn on_event<T>(&mut self, event: T, state: &mut EditorState)
Handles key and mouse events.
Sourcepub fn on_key_event<T>(&mut self, event: T, state: &mut EditorState)
pub fn on_key_event<T>(&mut self, event: T, state: &mut EditorState)
Handles key events.
Sourcepub fn on_mouse_event<T>(&self, event: T, state: &mut EditorState)where
T: Into<MouseEvent>,
pub fn on_mouse_event<T>(&self, event: T, state: &mut EditorState)where
T: Into<MouseEvent>,
Handles mouse events.
Sourcepub fn on_paste_event(&self, text: String, state: &mut EditorState)
pub fn on_paste_event(&self, text: String, state: &mut EditorState)
Handles paste events.
Trait Implementations§
Source§impl Clone for EditorEventHandler
impl Clone for EditorEventHandler
Source§fn clone(&self) -> EditorEventHandler
fn clone(&self) -> EditorEventHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EditorEventHandler
impl RefUnwindSafe for EditorEventHandler
impl Send for EditorEventHandler
impl Sync for EditorEventHandler
impl Unpin for EditorEventHandler
impl UnsafeUnpin for EditorEventHandler
impl UnwindSafe for EditorEventHandler
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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