summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-29 01:35:37 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-08-29 01:35:37 +0200
commita14b8bffc0037cc14f55b361b9591cf2657e6348 (patch)
tree765cc8924bc1276df46834db868852788297e112 /src
parentfafad2dfcab3b6bb11a705af61faf54e07e29773 (diff)
downloadiced-a14b8bffc0037cc14f55b361b9591cf2657e6348.tar.gz
iced-a14b8bffc0037cc14f55b361b9591cf2657e6348.tar.bz2
iced-a14b8bffc0037cc14f55b361b9591cf2657e6348.zip
Write documentation for `input`
Diffstat (limited to 'src')
-rw-r--r--src/input.rs1
-rw-r--r--src/input/button_state.rs4
-rw-r--r--src/input/keyboard.rs1
-rw-r--r--src/input/mouse.rs1
-rw-r--r--src/input/mouse/button.rs8
-rw-r--r--src/renderer.rs2
-rw-r--r--src/widget.rs2
7 files changed, 17 insertions, 2 deletions
diff --git a/src/input.rs b/src/input.rs
index 282d5c00..613d83f1 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -1,3 +1,4 @@
+//! Map your system events into input events that Iced can understand.
pub mod keyboard;
pub mod mouse;
diff --git a/src/input/button_state.rs b/src/input/button_state.rs
index e8845cc7..988043ba 100644
--- a/src/input/button_state.rs
+++ b/src/input/button_state.rs
@@ -1,5 +1,9 @@
+/// The state of a button.
#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
pub enum ButtonState {
+ /// The button is pressed.
Pressed,
+
+ /// The button is __not__ pressed.
Released,
}
diff --git a/src/input/keyboard.rs b/src/input/keyboard.rs
index 2b0188ff..57c24484 100644
--- a/src/input/keyboard.rs
+++ b/src/input/keyboard.rs
@@ -1,3 +1,4 @@
+//! Build keyboard events.
mod event;
mod key_code;
diff --git a/src/input/mouse.rs b/src/input/mouse.rs
index 49a62961..d37f5b96 100644
--- a/src/input/mouse.rs
+++ b/src/input/mouse.rs
@@ -1,3 +1,4 @@
+//! Build mouse events.
mod button;
mod event;
diff --git a/src/input/mouse/button.rs b/src/input/mouse/button.rs
index c51bedfc..aeb8a55d 100644
--- a/src/input/mouse/button.rs
+++ b/src/input/mouse/button.rs
@@ -1,7 +1,15 @@
+/// The button of a mouse.
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub enum Button {
+ /// The left mouse button.
Left,
+
+ /// The right mouse button.
Right,
+
+ /// The middle (wheel) button.
Middle,
+
+ /// Some other button.
Other(u8),
}
diff --git a/src/renderer.rs b/src/renderer.rs
index 3311f45e..b445190b 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -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.
//! Instead, every [`Widget`] constrains its generic `Renderer` type as
diff --git a/src/widget.rs b/src/widget.rs
index 909b58f9..420e5534 100644
--- a/src/widget.rs
+++ b/src/widget.rs
@@ -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
//! Every built-in drawable widget has its own module with a `Renderer` trait