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 action_ring;
14mod application_target;
15mod button;
16mod category;
17mod defaults;
18mod gesture;
19mod key_combo;
20mod swipe;
21mod value;
22
23#[cfg(test)]
24#[allow(clippy::expect_used, reason = "expect/unwrap are idiomatic in tests")]
25mod tests;
26
27pub use action::{Action, WorkflowStep};
28pub use action_ring::{
29    ActionRingConfig, ActionRingEntry, ActionRingIcon, ActionRingLayout, ActionRingSlot,
30    RingAction, RingActionError,
31};
32pub use application_target::{ApplicationTarget, ApplicationTargetError};
33pub use button::ButtonId;
34pub use category::Category;
35pub use defaults::{default_binding, default_binding_for, default_gesture_binding};
36pub use gesture::GestureDirection;
37pub use key_combo::{KeyCombo, KeyComboParseError, KeyboardUsage, KeyboardUsageError};
38pub use swipe::{
39    GESTURE_HOLD_FOR_SWIPE, GESTURE_SWIPE_DEADZONE, GESTURE_SWIPE_THRESHOLD, SwipeAccumulator,
40    detect_swipe,
41};
42pub use value::Binding;