NcInput

Type Alias 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.

Aliased Type§

#[repr(C)]
pub struct NcInput { pub id: u32, pub y: i32, pub x: i32, pub utf8: [u8; 5], pub alt: bool, pub shift: bool, pub ctrl: bool, pub evtype: u32, pub modifiers: u32, pub ypx: i32, pub xpx: i32, pub eff_text: [u32; 4], }

Fields§

§id: u32

Unicode codepoint or synthesized NCKEY event

§y: i32

y/x cell coordinate of event, -1 for undefined

§x: i32

y/x cell coordinate of event, -1 for undefined

§utf8: [u8; 5]

utf8 representation, if one exists

§alt: bool

was alt held?

§shift: bool

was shift held?

§ctrl: bool

was ctrl held?

§evtype: u32

END DEPRECATION

§modifiers: u32

bitmask over NCKEY_MOD_*

§ypx: i32

pixel offsets within cell, -1 for undefined

§xpx: i32

pixel offsets within cell, -1 for undefined

§eff_text: [u32; 4]

Effective