Skip to main content

Module binding

Module binding 

Source
Expand description

Logical mouse button identifiers and the action vocabulary each one can bind to. Lives in openlogi-core because the config schema serializes these directly — the GUI re-exports them.

When Action gains new variants, keep the existing variant names stable: the TOML config keys/values use the enum variant identifiers verbatim, so renames are migration events.

Modules are split by domain so concurrent feature work (new buttons, new actions, defaults, gesture maps) rarely edits the same file.

Structs§

ActionRingConfig
Per-device Actions Ring settings and application-specific layouts.
ActionRingEntry
One populated Actions Ring slot.
ActionRingLayout
The actions displayed at the eight fixed ring positions.
ApplicationTarget
Validated application, folder, filesystem, or URL target.
Cid
One HID++ 0x1b04 control, by its firmware control ID.
KeyCombo
A platform-neutral keyboard chord.
KeyboardUsage
USB HID keyboard usage supported by custom shortcuts.
KeyboardUsageError
Unsupported USB HID usage found in a shortcut payload.
KnownControl
A control OpenLogi knows by name.
LongPressBinding
The mutually exclusive actions of a threshold-based button binding.
ParseButtonIdError
A persisted button name that names no button.
RingAction
An action that is valid inside an Actions Ring.
SwipeAccumulator
The mid-swipe state machine shared by both gesture-capture paths: the HID++ HID++ gesture sources (openlogi-hid’s 0x1b04 raw-XY divert) and the OS-hook Back/Forward buttons (openlogi-agent-core’s CGEventTap). A gesture button’s hold accumulates travel; the instant the dominant axis commits a direction — after the button has been held GESTURE_HOLD_FOR_SWIPE, so a quick click whose cursor drifted doesn’t count — Self::accumulate returns that direction exactly once, like Logitech Options+. A hold that never commits is a plain click, reported by Self::end.

Enums§

Action
What pressing a ButtonId should do.
ActionRingIcon
Presentation icon for an Actions Ring slot.
ActionRingSlot
One of the eight fixed positions in an Actions Ring, clockwise from the top.
ApplicationTargetError
Why an application launch target could not be constructed.
Binding
What a single rebindable ButtonId does: one immediate Action, an independent short/long action pair, or — for a raw-XY-capable button placed in gesture mode — a per-GestureDirection map (hold + swipe up/down/left/right, or a plain click).
ButtonId
One of the user-rebindable controls on a Logi device: a mouse hotspot, or a keyboard key addressed by its HID++ 0x1b04 control ID.
Category
Grouping for popover section headers.
Effect
What firing an Action should do, independent of platform.
GestureDirection
One of the five sub-bindings on the gesture button: hold + swipe up/down/ left/right or a plain click without movement. Logi ships these as independent assignments (SLOT_NAME_GESTURE_*_BUTTON in the device_gesture_buttons_image metadata block) — OpenLogi mirrors the same shape.
KeyComboParseError
Why a user-entered keyboard shortcut could not be parsed.
MediaKey
A media/volume key.
MouseButton
A physical mouse button an Effect::Click should press.
NativeAction
A window-manager or power action with no shared cross-platform chord.
RingActionError
Why an Action cannot be placed in an Actions Ring slot.
Script
A power-user scripting escape hatch, borrowed from the originating Action::RunAppleScript, Action::RunShellCommand, or Action::Workflow.
Shortcut
A named shortcut whose chord is the same concept on every OS but not the same keys.
WorkflowStep
One step in a Action::Workflow. A workflow is a Vec<WorkflowStep> executed in order by the inject layer; Delay introduces a pause between the surrounding steps.

Constants§

GESTURE_HOLD_FOR_SWIPE
Minimum time a gesture button must be held before its travel can commit to a swipe. Distinguishes a deliberate hold-and-swipe from a quick click whose cursor happened to be moving. Shared by both gesture paths (the HID++ thumb pad and the OS-hook Back/Forward buttons).
GESTURE_SWIPE_DEADZONE
Maximum cross-axis travel allowed at the threshold, so only a reasonably straight swipe commits. Grows with the dominant axis (max(deadzone, 35%)).
GESTURE_SWIPE_THRESHOLD
Minimum dominant-axis travel (raw-XY units) before a held gesture commits to a direction. Tuned to match Logitech Options+’s responsiveness.
KNOWN_CONTROLS
Every control OpenLogi names, in the order a keyboard’s function row lays them out (brightness, backlight, then the shortcut and media keys, then the keys above the numpad). CIDs are Logitech’s own (the 0x1b04 control-ID list, cross-checked against Solaar’s special_keys.py and the slot IDs in Logi’s device metadata).
LONG_PRESS_THRESHOLD
How long a physical button must remain down before its independent long action fires.
UNKNOWN_CONTROL_TRANSLATION_KEY
Locale key for a control with no catalog row: the plain word “Control”, to which the GUI appends Cid::hex. Deliberately not an interpolating message — every caller resolves button keys with a bare tr!.

Functions§

default_binding
Sensible defaults for a fresh device so the panel isn’t empty on first run.
default_binding_for
The canonical default Binding for a fresh button in the merged model.
default_gesture_binding
Per-direction defaults for the gesture button. These are captured live over HID++ 0x1b04 (raw-XY diversion) and dispatched like any other binding; the defaults give the picker something sensible to show on first run.
detect_swipe
Classify the running raw-XY travel of a held gesture button into a directional swipe, the instant it commits — or None while it’s still too short or too diagonal.