Struct KeyEvent

pub struct KeyEvent(pub KeyCode, pub Modifiers);

Input key pressed and modifiers

Fields

0: KeyCode
1: Modifiers

Implementations

impl KeyEvent

fn new(c: char, mods: Modifiers) -> Self

Constructor from char and modifiers

fn ctrl(c: char) -> Self

Constructor from char with Ctrl modifier

fn alt(c: char) -> Self

Constructor from char with Alt modifier

fn normalize(e: Self) -> Self

ctrl-a => ctrl-A (uppercase) shift-A => A (no SHIFT modifier) shift-Tab => BackTab

Trait Implementations

impl Clone for KeyEvent

fn clone(&self) -> Self

impl Copy for KeyEvent

impl Debug for KeyEvent

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for KeyEvent

impl From<char> for KeyEvent

fn from(c: char) -> Self

impl Hash for KeyEvent

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for KeyEvent

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for KeyEvent

Auto Trait Implementations

impl Freeze for KeyEvent

impl RefUnwindSafe for KeyEvent

impl Send for KeyEvent

impl Sync for KeyEvent

impl Unpin for KeyEvent

impl UnsafeUnpin for KeyEvent

impl UnwindSafe for KeyEvent

Blanket Implementations

impl<T> Any for KeyEvent where T: 'static + ?Sized,

impl<T> Borrow<T> for KeyEvent where T: ?Sized,

impl<T> BorrowMut<T> for KeyEvent where T: ?Sized,

impl<T> CloneToUninit for KeyEvent where T: Clone,

impl<T> From<T> for KeyEvent

impl<T> ToOwned for KeyEvent where T: Clone,

impl<T, U> Into<U> for KeyEvent where U: From<T>,

impl<T, U> TryFrom<U> for KeyEvent where U: Into<T>,

impl<T, U> TryInto<U> for KeyEvent where U: TryFrom<T>,