Type Definition libnotcurses_sys::NcInput
source · pub type NcInput = ncinput;
Expand description
Reads and decodes input events.
Reads from stdin and decodes the input to stdout, including synthesized events and mouse events. Notcurses provides input from keyboards and mice.
Single Unicode codepoints are received from the keyboard, directly encoded
as u32
.
All events carry an NcInput
structure with them.
For mouse events, the x and y coordinates are reported within this struct. For all events, modifiers (e.g. “Alt”) are carried as bools in this struct.
Implementations§
source§impl NcInput
impl NcInput
sourcepub fn with_shift(id: char) -> NcInput
pub fn with_shift(id: char) -> NcInput
New NcInput
with shift
key.
sourcepub fn with_all_args(
id: char,
x: Option<u32>,
y: Option<u32>,
modifiers: NcKeyMod,
evtype: NcInputType
) -> NcInput
pub fn with_all_args(
id: char,
x: Option<u32>,
y: Option<u32>,
modifiers: NcKeyMod,
evtype: NcInputType
) -> NcInput
New NcInput
, expecting all the arguments (except utf8).
source§impl NcInput
impl NcInput
sourcepub fn nomod_p(&self) -> bool
pub fn nomod_p(&self) -> bool
Returns true if there are no modifiers present.
C style function: ncinput_nomod_p().
sourcepub fn shift_p(&self) -> bool
pub fn shift_p(&self) -> bool
Returns true if the Shift
modifier is present.
C style function: ncinput_shift_p().
sourcepub fn alt_p(&self) -> bool
pub fn alt_p(&self) -> bool
Returns true if the Alt
modifier is present.
C style function: ncinput_alt_p().
sourcepub fn ctrl_p(&self) -> bool
pub fn ctrl_p(&self) -> bool
Returns true if the Ctrl
modifier is present.
C style function: ncinput_ctrl_p().
sourcepub fn meta_p(&self) -> bool
pub fn meta_p(&self) -> bool
Returns true if the Meta
modifier is present.
C style function: ncinput_meta_p().
sourcepub fn super_p(&self) -> bool
pub fn super_p(&self) -> bool
Returns true if the Super
modifier is present.
C style function: ncinput_super_p().
sourcepub fn hyper_p(&self) -> bool
pub fn hyper_p(&self) -> bool
Returns true if the Hyper
modifier is present.
C style function: ncinput_hyper_p().
sourcepub fn capslock_p(&self) -> bool
pub fn capslock_p(&self) -> bool
Returns true if the CapsLock
modifier is present.
C style function: ncinput_capslock_p().
sourcepub fn numlock_p(&self) -> bool
pub fn numlock_p(&self) -> bool
Returns true if the NumLock
modifier is present.
C style function: ncinput_numlock_p().
sourcepub fn equal_p(&self, other: &NcInput) -> bool
pub fn equal_p(&self, other: &NcInput) -> bool
Returns true if both NcInput
s are equal.
C style function: ncinput_equal_p().