Key

Struct Key 

Source
pub struct Key(/* private fields */);
Expand description

A synthesized Received input event other than a char.

Implementations§

Source§

impl Key

§constants

Source

pub const Invalid: Key

Source

pub const Resize: Key

we received SIGWINCH.

Source

pub const Up: Key

Source

pub const Right: Key

Source

pub const Down: Key

Source

pub const Left: Key

Source

pub const Ins: Key

Source

pub const Del: Key

Source

pub const Backspace: Key

Source

pub const PgDown: Key

Source

pub const PgUp: Key

Source

pub const Home: Key

Source

pub const End: Key

Source

pub const F00: Key

Source

pub const F01: Key

Source

pub const F02: Key

Source

pub const F03: Key

Source

pub const F04: Key

Source

pub const F05: Key

Source

pub const F06: Key

Source

pub const F07: Key

Source

pub const F08: Key

Source

pub const F09: Key

Source

pub const F10: Key

Source

pub const F11: Key

Source

pub const F12: Key

Source

pub const F13: Key

Source

pub const F14: Key

Source

pub const F15: Key

Source

pub const F16: Key

Source

pub const F17: Key

Source

pub const F18: Key

Source

pub const F19: Key

Source

pub const F20: Key

Source

pub const F21: Key

Source

pub const F22: Key

Source

pub const F23: Key

Source

pub const F24: Key

Source

pub const F25: Key

Source

pub const F26: Key

Source

pub const F27: Key

Source

pub const F28: Key

Source

pub const F29: Key

Source

pub const F30: Key

Source

pub const F31: Key

Source

pub const F32: Key

Source

pub const F33: Key

Source

pub const F34: Key

Source

pub const F35: Key

Source

pub const F36: Key

Source

pub const F37: Key

Source

pub const F38: Key

Source

pub const F39: Key

Source

pub const F40: Key

Source

pub const F41: Key

Source

pub const F42: Key

Source

pub const F43: Key

Source

pub const F44: Key

Source

pub const F45: Key

Source

pub const F46: Key

Source

pub const F47: Key

Source

pub const F48: Key

Source

pub const F49: Key

Source

pub const F50: Key

Source

pub const F51: Key

Source

pub const F52: Key

Source

pub const F53: Key

Source

pub const F54: Key

Source

pub const F55: Key

Source

pub const F56: Key

Source

pub const F57: Key

Source

pub const F58: Key

Source

pub const F59: Key

Source

pub const F60: Key

Source

pub const Enter: Key

Source

pub const Cls: Key

“clear-screen or erase”

Source

pub const DLeft: Key

down + left on keypad

Source

pub const DRight: Key

Source

pub const ULeft: Key

up + left on keypad

Source

pub const URight: Key

Source

pub const Center: Key

Source

pub const Begin: Key

Source

pub const Cancel: Key

Source

pub const Close: Key

Source

pub const Command: Key

Source

pub const Copy: Key

Source

pub const Exit: Key

Source

pub const Print: Key

Source

pub const Refresh: Key

Source

pub const CapsLock: Key

Source

pub const ScrollLock: Key

Source

pub const NumLock: Key

Source

pub const PrintScreen: Key

Source

pub const Pause: Key

Source

pub const Menu: Key

Source

pub const MediaPlay: Key

Source

pub const MediaPause: Key

Source

pub const MediaPPause: Key

Source

pub const MediaRev: Key

Source

pub const MediaStop: Key

Source

pub const MediaFF: Key

Source

pub const MediaRewind: Key

Source

pub const MediaNext: Key

Source

pub const MediaPrev: Key

Source

pub const MediaRecord: Key

Source

pub const MediaLVol: Key

Source

pub const MediaRVol: Key

Source

pub const MediaMute: Key

Source

pub const LShift: Key

Source

pub const LCtrl: Key

Source

pub const LAlt: Key

Source

pub const LSuper: Key

Source

pub const LHyper: Key

Source

pub const LMeta: Key

Source

pub const RShift: Key

Source

pub const RCtrl: Key

Source

pub const RAlt: Key

Source

pub const RSuper: Key

Source

pub const RHyper: Key

Source

pub const RMeta: Key

Source

pub const L3Shift: Key

AltGr in european keyboards

Source

pub const L5Shift: Key

Source

pub const Motion: Key

Source

pub const Button1: Key

Source

pub const Button2: Key

Source

pub const Button3: Key

Source

pub const Button4: Key

scrollwheel up

Source

pub const Button5: Key

scrollwheel down

Source

pub const Button6: Key

Source

pub const Button7: Key

Source

pub const Button8: Key

Source

pub const Button9: Key

Source

pub const Button10: Key

Source

pub const Button11: Key

Source

pub const Signal: Key

we received SIGCONT

Source

pub const Eof: Key

Will be returned upon reaching the end of input.

Source

pub const Tab: Key

Source

pub const Esc: Key

Source

pub const Space: Key

Source§

impl Key

§Aliases

Source

pub const ScrollUp: Key

Alias of Button4

Source

pub const Scrolldown: Key

Alias of Button5

Source

pub const Return: Key

Alias of Enter

Source§

impl Key

§methods

Source

pub fn is(num: u32) -> bool

Checks whether a number falls in the range of synthesized events.

Source

pub fn new(num: u32) -> Option<Self>

Returns a new Key if the provided number falls in the correct range.

Source

pub fn is_function(&self) -> bool

Returns true if it’s a function key event.

Source

pub fn is_media(&self) -> bool

Returns true if it’s a multimedia key event.

Source

pub fn is_mouse(&self) -> bool

Returns true if it’s a mouse event.

Source

pub fn is_resize(&self) -> bool

Returns true if it’s a resize event.

Source

pub fn name(&self) -> &'static str

Returns the name of the current Key.

Source

pub fn check_name(num: u32) -> &'static str

Returns the name of the Key the number would be.

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Key

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Key

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<Key> for NcKey

Source§

fn from(k: Key) -> NcKey

Converts to this type from the input type.
Source§

impl From<NcKey> for Key

Source§

fn from(nc: NcKey) -> Key

Converts to this type from the input type.
Source§

impl PartialEq for Key

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Key

Source§

impl Eq for Key

Source§

impl StructuralPartialEq for Key

Auto Trait Implementations§

§

impl Freeze for Key

§

impl RefUnwindSafe for Key

§

impl Send for Key

§

impl Sync for Key

§

impl Unpin for Key

§

impl UnwindSafe for Key

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.