Write documentation for input

This commit is contained in:
Héctor Ramón Jiménez 2019-08-29 01:35:37 +02:00
parent fafad2dfca
commit a14b8bffc0
7 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,4 @@
//! Map your system events into input events that Iced can understand.
pub mod keyboard; pub mod keyboard;
pub mod mouse; pub mod mouse;

View file

@ -1,5 +1,9 @@
/// The state of a button.
#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)] #[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
pub enum ButtonState { pub enum ButtonState {
/// The button is pressed.
Pressed, Pressed,
/// The button is __not__ pressed.
Released, Released,
} }

View file

@ -1,3 +1,4 @@
//! Build keyboard events.
mod event; mod event;
mod key_code; mod key_code;

View file

@ -1,3 +1,4 @@
//! Build mouse events.
mod button; mod button;
mod event; mod event;

View file

@ -1,7 +1,15 @@
/// The button of a mouse.
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub enum Button { pub enum Button {
/// The left mouse button.
Left, Left,
/// The right mouse button.
Right, Right,
/// The middle (wheel) button.
Middle, Middle,
/// Some other button.
Other(u8), Other(u8),
} }

View file

@ -1,4 +1,4 @@
//! Write your own renderer! //! Write your own renderer.
//! //!
//! There is not a common entrypoint or trait for a __renderer__ in Iced. //! There is not a common entrypoint or trait for a __renderer__ in Iced.
//! Instead, every [`Widget`] constrains its generic `Renderer` type as //! Instead, every [`Widget`] constrains its generic `Renderer` type as

View file

@ -1,4 +1,4 @@
//! Use the built-in widgets or create your own! //! Use the built-in widgets or create your own.
//! //!
//! # Built-in widgets //! # Built-in widgets
//! Every built-in drawable widget has its own module with a `Renderer` trait //! Every built-in drawable widget has its own module with a `Renderer` trait