#[repr(C)]pub struct ncinput {
pub id: u32,
pub y: c_int,
pub x: c_int,
pub utf8: [c_char; 5],
pub alt: bool,
pub shift: bool,
pub ctrl: bool,
pub evtype: ncintype_e,
pub modifiers: c_uint,
pub ypx: c_int,
pub xpx: c_int,
pub eff_text: [u32; 4],
}
Expand description
An input event. Cell coordinates are currently defined only for mouse events. It is not guaranteed that we can set the modifiers for a given ncinput. We encompass single Unicode codepoints, not complete EGCs. FIXME for abi4, combine the bools into |modifiers|
Fields§
§id: u32
Unicode codepoint or synthesized NCKEY event
y: c_int
y/x cell coordinate of event, -1 for undefined
x: c_int
y/x cell coordinate of event, -1 for undefined
utf8: [c_char; 5]
utf8 representation, if one exists
alt: bool
was alt held?
shift: bool
was shift held?
ctrl: bool
was ctrl held?
evtype: ncintype_e
END DEPRECATION
modifiers: c_uint
bitmask over NCKEY_MOD_*
ypx: c_int
pixel offsets within cell, -1 for undefined
xpx: c_int
pixel offsets within cell, -1 for undefined
eff_text: [u32; 4]
Effective
Implementations§
Source§impl ncinput
§Constructors
impl ncinput
§Constructors
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
§Methods
impl ncinput
§Methods
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().