diff --git a/Cargo.toml b/Cargo.toml index cfdfafd..cfe2b59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,3 +53,6 @@ required-features = ["crossterm"] [[example]] name = "variable" required-features = ["crossterm"] + +[package.metadata.docs.rs] +all-features = true diff --git a/src/input.rs b/src/input.rs index a9a2e1e..5131031 100644 --- a/src/input.rs +++ b/src/input.rs @@ -67,7 +67,7 @@ pub struct Input { } impl Default for Input { - /// The default input is [`Key::Null`] without pressing Ctrl nor Alt, which means invalid input. + /// The default input is [`Key::Null`] without pressing any modifier keys, which means invalid input. fn default() -> Self { Input { key: Key::Null, @@ -79,6 +79,7 @@ impl Default for Input { #[cfg(feature = "crossterm")] impl From for Input { + /// Convert [`crossterm::event::Event`] to [`Input`]. fn from(event: CrosstermEvent) -> Self { if let CrosstermEvent::Key(key) = event { Self::from(key) @@ -90,6 +91,7 @@ impl From for Input { #[cfg(feature = "crossterm")] impl From for Input { + /// Convert [`crossterm::event::KeyEvent`] to [`Input`]. fn from(key: KeyEvent) -> Self { let ctrl = key.modifiers.contains(KeyModifiers::CONTROL); let alt = key.modifiers.contains(KeyModifiers::ALT); @@ -117,6 +119,7 @@ impl From for Input { #[cfg(feature = "termion")] impl From for Input { + /// Convert [`termion::event::Event`] to [`Input`]. fn from(event: TerimonEvent) -> Self { if let TerimonEvent::Key(key) = event { Self::from(key) @@ -128,6 +131,7 @@ impl From for Input { #[cfg(feature = "termion")] impl From for Input { + /// Convert [`termion::event::Key`] to [`Input`]. fn from(key: TermionKey) -> Self { use TermionKey::*;