Skip to main content

Module bindings

Module bindings 

Source
Expand description

Binding-map construction: overlay the stored per-device (and per-app) bindings on top of the built-in defaults.

Keyed by config_key (Option<&str>) rather than any UI device record so both the agent and the GUI can build the effective map from a Config.

Functions§

bindings_for
Effective per-button single-action map for the device config_key, with app_bundle’s per-app overlay applied. Unset buttons fall back to default_binding.
hidpp_gesture_maps_for
Per-direction maps for every HID++ gesture source (the dedicated gesture button, the MX Master 4 haptic panel) in gesture mode on config_key, keyed by the button its captured swipes dispatch as. Each map is seeded via Binding::fill_gesture_defaults — the one canonical seeding rule — so the watcher always dispatches the full five-direction set the GUI shows. Empty when no HID++ source gestures (or config_key is None).
oshook_gestures_for
Per-direction maps for every OS-hook button (Middle/Back/Forward) in gesture mode on config_key, with app_bundle’s per-app overlay applied, for the OS hook to resolve a hold+swipe. Gesture mode is per-button (see Config::is_gesture_mode), so any number of entries may be live at once — concurrency between them is the hook’s first-hold-wins policy, not a config concern.