Skip to main content

openlogi_core/
binding.rs

1//! Logical mouse button identifiers and the action vocabulary each one can
2//! bind to. Lives in `openlogi-core` because the [`config`](crate::config)
3//! schema serializes these directly — the GUI re-exports them.
4//!
5//! When [`Action`] gains new variants, keep the existing variant names stable:
6//! the TOML config keys/values use the enum variant identifiers verbatim, so
7//! renames are migration events.
8//!
9//! Modules are split by domain so concurrent feature work (new buttons, new
10//! actions, defaults, gesture maps) rarely edits the same file.
11
12mod action;
13mod button;
14mod category;
15mod defaults;
16mod gesture;
17mod key_combo;
18mod swipe;
19mod value;
20
21#[cfg(test)]
22#[allow(clippy::expect_used, reason = "expect/unwrap are idiomatic in tests")]
23mod tests;
24
25pub use action::{Action, WorkflowStep};
26pub use button::ButtonId;
27pub use category::Category;
28pub use defaults::{default_binding, default_binding_for, default_gesture_binding};
29pub use gesture::GestureDirection;
30pub use key_combo::KeyCombo;
31pub use swipe::{
32    GESTURE_HOLD_FOR_SWIPE, GESTURE_SWIPE_DEADZONE, GESTURE_SWIPE_THRESHOLD, SwipeAccumulator,
33    detect_swipe,
34};
35pub use value::Binding;