Write documentation for input
This commit is contained in:
parent
fafad2dfca
commit
a14b8bffc0
7 changed files with 17 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! Build keyboard events.
|
||||||
mod event;
|
mod event;
|
||||||
mod key_code;
|
mod key_code;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! Build mouse events.
|
||||||
mod button;
|
mod button;
|
||||||
mod event;
|
mod event;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue