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