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 control;
18mod defaults;
19mod effect;
20mod gesture;
21mod key_combo;
22mod swipe;
23mod value;
24
25#[cfg(test)]
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, ParseButtonIdError};
35pub use category::Category;
36pub use control::{Cid, KNOWN_CONTROLS, KnownControl, UNKNOWN_CONTROL_TRANSLATION_KEY};
37pub use defaults::{default_binding, default_binding_for, default_gesture_binding};
38pub use effect::{Effect, MediaKey, MouseButton, NativeAction, Script, Shortcut};
39pub use gesture::GestureDirection;
40pub use key_combo::{KeyCombo, KeyComboParseError, KeyboardUsage, KeyboardUsageError};
41pub use swipe::{
42    GESTURE_HOLD_FOR_SWIPE, GESTURE_SWIPE_DEADZONE, GESTURE_SWIPE_THRESHOLD, SwipeAccumulator,
43    detect_swipe,
44};
45pub use value::{Binding, LONG_PRESS_THRESHOLD, LongPressBinding};