Struct NcKey

Source
#[repr(transparent)]
pub struct NcKey(pub u32);
Expand description

A synthesized input event.

This means any input event we can report that isn’t representative of some Unicode. This covers both keyboard and mouse events, as well as signals and even window events.

See also PRETERUNICODEBASE.

Tuple Fields§

§0: u32

Implementations§

Source§

impl NcKey

§Constants

Source

pub const Invalid: NcKey

Source

pub const Resize: NcKey

we received SIGWINCH.

Source

pub const Up: NcKey

Source

pub const Right: NcKey

Source

pub const Down: NcKey

Source

pub const Left: NcKey

Source

pub const Ins: NcKey

Source

pub const Del: NcKey

Source

pub const Backspace: NcKey

Source

pub const PgDown: NcKey

Source

pub const PgUp: NcKey

Source

pub const Home: NcKey

Source

pub const End: NcKey

Source

pub const F00: NcKey

Source

pub const F01: NcKey

Source

pub const F02: NcKey

Source

pub const F03: NcKey

Source

pub const F04: NcKey

Source

pub const F05: NcKey

Source

pub const F06: NcKey

Source

pub const F07: NcKey

Source

pub const F08: NcKey

Source

pub const F09: NcKey

Source

pub const F10: NcKey

Source

pub const F11: NcKey

Source

pub const F12: NcKey

Source

pub const F13: NcKey

Source

pub const F14: NcKey

Source

pub const F15: NcKey

Source

pub const F16: NcKey

Source

pub const F17: NcKey

Source

pub const F18: NcKey

Source

pub const F19: NcKey

Source

pub const F20: NcKey

Source

pub const F21: NcKey

Source

pub const F22: NcKey

Source

pub const F23: NcKey

Source

pub const F24: NcKey

Source

pub const F25: NcKey

Source

pub const F26: NcKey

Source

pub const F27: NcKey

Source

pub const F28: NcKey

Source

pub const F29: NcKey

Source

pub const F30: NcKey

Source

pub const F31: NcKey

Source

pub const F32: NcKey

Source

pub const F33: NcKey

Source

pub const F34: NcKey

Source

pub const F35: NcKey

Source

pub const F36: NcKey

Source

pub const F37: NcKey

Source

pub const F38: NcKey

Source

pub const F39: NcKey

Source

pub const F40: NcKey

Source

pub const F41: NcKey

Source

pub const F42: NcKey

Source

pub const F43: NcKey

Source

pub const F44: NcKey

Source

pub const F45: NcKey

Source

pub const F46: NcKey

Source

pub const F47: NcKey

Source

pub const F48: NcKey

Source

pub const F49: NcKey

Source

pub const F50: NcKey

Source

pub const F51: NcKey

Source

pub const F52: NcKey

Source

pub const F53: NcKey

Source

pub const F54: NcKey

Source

pub const F55: NcKey

Source

pub const F56: NcKey

Source

pub const F57: NcKey

Source

pub const F58: NcKey

Source

pub const F59: NcKey

Source

pub const F60: NcKey

Source

pub const Enter: NcKey

Source

pub const Cls: NcKey

“clear-screen or erase”

Source

pub const DLeft: NcKey

down + left on keypad

Source

pub const DRight: NcKey

Source

pub const ULeft: NcKey

up + left on keypad

Source

pub const URight: NcKey

Source

pub const Center: NcKey

Source

pub const Begin: NcKey

Source

pub const Cancel: NcKey

Source

pub const Close: NcKey

Source

pub const Command: NcKey

Source

pub const Copy: NcKey

Source

pub const Exit: NcKey

Source

pub const Print: NcKey

Source

pub const Refresh: NcKey

Source

pub const CapsLock: NcKey

Source

pub const ScrollLock: NcKey

Source

pub const NumLock: NcKey

Source

pub const PrintScreen: NcKey

Source

pub const Pause: NcKey

Source

pub const Menu: NcKey

Source

pub const MediaPlay: NcKey

Source

pub const MediaPause: NcKey

Source

pub const MediaPPause: NcKey

Source

pub const MediaRev: NcKey

Source

pub const MediaStop: NcKey

Source

pub const MediaFF: NcKey

Source

pub const MediaRewind: NcKey

Source

pub const MediaNext: NcKey

Source

pub const MediaPrev: NcKey

Source

pub const MediaRecord: NcKey

Source

pub const MediaLVol: NcKey

Source

pub const MediaRVol: NcKey

Source

pub const MediaMute: NcKey

Source

pub const LShift: NcKey

Source

pub const LCtrl: NcKey

Source

pub const LAlt: NcKey

Source

pub const LSuper: NcKey

Source

pub const LHyper: NcKey

Source

pub const LMeta: NcKey

Source

pub const RShift: NcKey

Source

pub const RCtrl: NcKey

Source

pub const RAlt: NcKey

Source

pub const RSuper: NcKey

Source

pub const RHyper: NcKey

Source

pub const RMeta: NcKey

Source

pub const L3Shift: NcKey

AltGr in european keyboards

Source

pub const L5Shift: NcKey

Source

pub const Motion: NcKey

Source

pub const Button1: NcKey

Source

pub const Button2: NcKey

Source

pub const Button3: NcKey

Source

pub const Button4: NcKey

scrollwheel up

Source

pub const Button5: NcKey

scrollwheel down

Source

pub const Button6: NcKey

Source

pub const Button7: NcKey

Source

pub const Button8: NcKey

Source

pub const Button9: NcKey

Source

pub const Button10: NcKey

Source

pub const Button11: NcKey

Source

pub const Signal: NcKey

we received SIGCONT

Source

pub const Eof: NcKey

Will be returned upon reaching the end of input.

Source

pub const Tab: NcKey

Source

pub const Esc: NcKey

Source

pub const Space: NcKey

Source§

impl NcKey

§Aliases

Source

pub const ScrollUp: NcKey

Alias of Button4

Source

pub const Scrolldown: NcKey

Alias of Button5

Source

pub const Return: NcKey

Alias of Enter

Source§

impl NcKey

§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 NcKey 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 NcKey.

Source

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

Returns the name of the NcKey the number would be.

Trait Implementations§

Source§

impl Clone for NcKey

Source§

fn clone(&self) -> NcKey

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 NcKey

Source§

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

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

impl Display for NcKey

Source§

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

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

impl From<NcKey> for u32

Source§

fn from(k: NcKey) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for NcKey

Source§

fn eq(&self, other: &NcKey) -> 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 NcKey

Source§

impl Eq for NcKey

Source§

impl StructuralPartialEq for NcKey

Auto Trait Implementations§

§

impl Freeze for NcKey

§

impl RefUnwindSafe for NcKey

§

impl Send for NcKey

§

impl Sync for NcKey

§

impl Unpin for NcKey

§

impl UnwindSafe for NcKey

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.