puppetmaster/lib.rs
1//! # Puppetmaster
2//!
3//! Easy-to-use input handling for writing games.
4//!
5//! This crate exposes different kinds of input handlers. Pick which one to use based on how your game engine
6//! provides you with input data.
7//!
8//! - [`EventInputHandler`] for when your game engine uses events
9//! - [`PollingInputHandler`] for when your game engine provides a set of the currently pressed keys
10//! - [`QueryInputHandler`] for when your game engine provides a function to call to query the state of a key.
11//!
12//! ## Inputs vs Controls
13//!
14//! This crate makes a distinction between *inputs* and *controls*.
15//! *Inputs* are the raw keycodes your game engine feeds to you; *controls* are what your game does about it.
16//!
17//! So, something like `Key::W` would be an input, predefined by your game engine,
18//! and you could map it to a `Control::Up` you defined in your game's code.
19//!
20//! Multiple inputs can map to the same control, but not vice versa. So, both the W key and the up arrow could
21//! map to `Control::Up`, but you couldn't have the shift key map to both Crouch and Sprint.
22
23mod event;
24mod polling;
25mod query;
26
27pub use event::EventInputHandler;
28pub use polling::PollingInputHandler;
29pub use query::QueryInputHandler;