pub enum ArrowDirection {
Left,
Right,
Up,
Down,
LineStart,
LineEnd,
DocumentStart,
DocumentEnd,
}Expand description
Arrow key / cursor navigation directions
Variants§
Left
Right
Up
Down
LineStart
Home key: move to start of current line
LineEnd
End key: move to end of current line
DocumentStart
Ctrl+Home: move to start of document
DocumentEnd
Ctrl+End: move to end of document
Implementations§
Source§impl ArrowDirection
impl ArrowDirection
Sourcepub fn from_key(vk: VirtualKeyCode, ctrl: bool) -> Option<Self>
pub fn from_key(vk: VirtualKeyCode, ctrl: bool) -> Option<Self>
Map a VirtualKeyCode plus the ctrl modifier into an ArrowDirection.
Returns None if the key is not a navigation key.
Sourcepub fn to_selection(self, ctrl: bool) -> (SelectionDirection, SelectionStep)
pub fn to_selection(self, ctrl: bool) -> (SelectionDirection, SelectionStep)
Convert to a (SelectionDirection, SelectionStep) pair for the
selection-op interpreter. ctrl upgrades arrow keys to word jumps.
Trait Implementations§
Source§impl Clone for ArrowDirection
impl Clone for ArrowDirection
Source§fn clone(&self) -> ArrowDirection
fn clone(&self) -> ArrowDirection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArrowDirection
impl Debug for ArrowDirection
Source§impl Hash for ArrowDirection
impl Hash for ArrowDirection
Source§impl PartialEq for ArrowDirection
impl PartialEq for ArrowDirection
Source§fn eq(&self, other: &ArrowDirection) -> bool
fn eq(&self, other: &ArrowDirection) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ArrowDirection
impl Eq for ArrowDirection
impl StructuralPartialEq for ArrowDirection
Auto Trait Implementations§
impl Freeze for ArrowDirection
impl RefUnwindSafe for ArrowDirection
impl Send for ArrowDirection
impl Sync for ArrowDirection
impl Unpin for ArrowDirection
impl UnsafeUnpin for ArrowDirection
impl UnwindSafe for ArrowDirection
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