[−][src]Struct mortal::terminal::PrepareConfig
Configures a Terminal
or Screen
instance to read special input.
This struct implements the Default
trait, providing default
values for all options.
To override only some options while using the remaining default values, one may use the following construct:
use mortal::{Terminal, PrepareConfig}; let term = Terminal::new()?; let state = term.prepare(PrepareConfig{ enable_keypad: false, enable_mouse: true, .. PrepareConfig::default() })?; // ... term.restore(state)?;
Fields
block_signals: bool
Whether to block signals that result from user input.
If true
, e.g. when the user presses Ctrl-C,
Key(Ctrl('c'))
will be read instead of Signal(Interrupt)
.
The default is true
.
enable_control_flow: bool
Whether to enable control flow characters.
The default is false
.
Notes
On Unix, when this setting is enabled, Ctrl-S and Ctrl-Q will stop and start, respectively, terminal input from being processed.
On Windows, this setting has no effect.
enable_keypad: bool
If true
, the terminal will be configured to generate events from
function keys.
The default is true
.
Notes
On Unix, this may be required to receive events for arrow keys.
On Windows, this setting has no effect.
enable_mouse: bool
If true
, the terminal will be configured to generate events for
mouse input, if supported, and read_event
may return Event::Mouse(_)
.
The default is false
.
Notes
This setting may not be supported on all systems.
always_track_motion: bool
If true
, mouse motion events will always be reported.
If false
, such events will only be reported while at least one mouse
button is pressed.
Mouse events are only reported if enable_mouse
is true
.
The default is false
.
report_signals: SignalSet
For each signal in the set, a signal handler will intercept the signal
and report it by returning an Event::Signal(_)
value.
block_signals
must be false
for any of these signals to be received.
By default, no signals are reported.
Trait Implementations
impl Clone for PrepareConfig
[src]
fn clone(&self) -> PrepareConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PrepareConfig
[src]
impl Debug for PrepareConfig
[src]
impl Default for PrepareConfig
[src]
fn default() -> PrepareConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrepareConfig
impl Send for PrepareConfig
impl Sync for PrepareConfig
impl Unpin for PrepareConfig
impl UnwindSafe for PrepareConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,