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,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,
}

View file

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

View file

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

View file

@ -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),
}