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 effect;
19mod gesture;
20mod key_combo;
21mod swipe;
22mod value;
23
24#[cfg(test)]
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 effect::{Effect, MediaKey, MouseButton, NativeAction, Script, Shortcut};
37pub use gesture::GestureDirection;
38pub use key_combo::{KeyCombo, KeyComboParseError, KeyboardUsage, KeyboardUsageError};
39pub use swipe::{
40    GESTURE_HOLD_FOR_SWIPE, GESTURE_SWIPE_DEADZONE, GESTURE_SWIPE_THRESHOLD, SwipeAccumulator,
41    detect_swipe,
42};
43pub use value::Binding;