crossterm_keybind/lib.rs
1//! This crate help you build tui with keybings config in an easy way.
2//! When building a tui application, we need address following topics.
3//! - `Define a set of keybing for some events`
4//! - `Capture one/some key bindings and perform one the event`
5//! - `Display a prompt of a key bindings`
6//! - `Provide a config file and let user to change all or part of it`
7//!
8//! These topics can be abstract these into [`KeyBindTrait`], and the key binding serialize and deserialize
9//! to a config file are solved in this crate.
10//!
11//! There still are a lot of trivial works, ahead you and your great ideal to build tui application.
12//! This crate also provides derive macro [KeyBind](https://docs.rs/crossterm-keybind-derive/latest/crossterm_keybind_derive/derive.KeyBind.html)
13//! to generate the the keyconfig in a supper easy way, you can have a toml key config for your
14//! events and allow user to patch part of it.
15
16mod error;
17mod traits;
18
19#[cfg(feature = "crossterm_0_29_0")]
20pub use crossterm_0_29_0::event;
21#[cfg(feature = "crossterm_0_28_1")]
22pub use crossterm_0_28_1::event;
23#[cfg(feature = "derive")]
24pub use crossterm_keybind_derive::KeyBind;
25pub use error::Error;
26#[cfg(feature = "derive")]
27pub use struct_patch;
28#[cfg(feature = "derive")]
29pub use toml;
30#[cfg(feature = "derive")]
31pub use toml_example;
32#[cfg(feature = "derive")]
33pub use log;
34pub use traits::KeyBindTrait;
35
36pub use crossterm_keybind_core::{KeyBinding, KeyBindings, DisplayFormat};