pub struct DeviceConfig {Show 21 fields
pub enabled: bool,
pub custom_name: Option<String>,
pub identity: Option<DeviceIdentity>,
pub links: BTreeMap<String, LinkConfig>,
pub bindings: BTreeMap<ButtonId, Binding>,
pub disabled_gestures: BTreeMap<ButtonId, BTreeMap<GestureDirection, Action>>,
pub per_app_bindings: BTreeMap<String, BTreeMap<ButtonId, Action>>,
pub action_ring: ActionRingConfig,
pub dpi_presets: Vec<Dpi>,
pub dpi: Option<Dpi>,
pub lighting: Option<Lighting>,
pub light: Option<LightSettings>,
pub smartshift: Option<SmartShift>,
pub camera_controls: Option<CameraControls>,
pub camera_profiles: BTreeMap<String, CameraControls>,
pub camera_profile: Option<String>,
pub thumbwheel_sensitivity: Option<ThumbwheelSensitivity>,
pub invert_scroll: bool,
pub scroll_resolution: Option<ScrollResolution>,
pub host_switch_targets: Vec<String>,
pub fn_lock: Option<bool>,
/* private fields */
}Expand description
Settings scoped to a single physical device.
Deserialization goes through RawDeviceConfig (#[serde(from)]) so
pre-v2 files — which split bindings across button_bindings +
gesture_bindings — fold into the unified Self::bindings map. Only
bindings is ever serialized, so a migrated file is rewritten to the v2
shape on its next save.
Fields§
§enabled: boolWhether OpenLogi manages this device at all. false leaves the device
fully native: no capture session (no HID++ diversion of any control)
and no volatile-settings re-apply on reconnect. Defaults to true and
is only serialized when disabled.
custom_name: Option<String>User-assigned name for this physical device. The persisted
DeviceIdentity::display_name remains the hardware model name so an
inventory refresh can never overwrite this alias or mistake it for
model metadata.
identity: Option<DeviceIdentity>Last-known identity (name / kind / capabilities), captured while the
device was online. Lets the UI render this device — with the right
config panels — on a cold start before any probe, or while it sleeps.
None for configs written before this field existed or by hand.
links: BTreeMap<String, LinkConfig>Routes this device has been seen on. Keys are
DeviceStableId::route_key; see LinkConfig.
bindings: BTreeMap<ButtonId, Binding>Every rebindable button’s binding: a single Action, an independent
short/long action pair, or — for a button in gesture mode — a
Binding::Gesture per-direction map.
disabled_gestures: BTreeMap<ButtonId, BTreeMap<GestureDirection, Action>>Direction maps of buttons whose gesture mode is currently OFF, keyed by
button — pure UX memory so re-enabling restores the user’s customized
arms exactly
(see Config::set_gesture_mode).
Never dispatched: the runtime reads only bindings, where a demoted
button is a Binding::Single of its former Click.
per_app_bindings: BTreeMap<String, BTreeMap<ButtonId, Action>>Per-application binding overlays (P1.4). Keyed by bundle identifier
(e.g. "com.microsoft.VSCode" on macOS). When the foreground app’s
id matches a key here, those bindings take precedence; anything not
listed falls through to bindings. Deliberately Action-valued (not
Binding): a per-app override replaces the whole button with one
action, never a per-direction gesture overlay.
action_ring: ActionRingConfigHost-rendered Actions Ring settings and complete per-application layouts.
dpi_presets: Vec<Dpi>Ordered list of DPI presets cycled through by
Action::CycleDpiPresets and indexed by
Action::SetDpiPreset. Empty means “no presets configured” —
the cycle action becomes a no-op until the user adds at least one.
dpi: Option<Dpi>The sensor DPI the user committed for this device. Persisted because
the value lives in device RAM and resets on a power cycle (#189); the
agent re-applies it when the device reconnects. None until the user
first changes DPI.
lighting: Option<Lighting>Per-device RGB lighting (static color + brightness + on/off). None
until the user changes it, so it stays out of config.toml otherwise.
light: Option<LightSettings>Per-device standalone-light settings. Separate from Self::lighting,
which is the existing HID++ keyboard RGB configuration.
smartshift: Option<SmartShift>Per-device SmartShift wheel configuration, re-applied on reconnect for
the same reason as Self::dpi. None until the user changes it.
camera_controls: Option<CameraControls>Per-webcam UVC image controls (brightness/contrast/…). None until the
user adjusts one, so it stays out of config.toml otherwise.
camera_profiles: BTreeMap<String, CameraControls>User-saved camera profiles (name → control snapshot). Built-in profiles (Default / Streaming / Video call) live in the GUI, not here.
camera_profile: Option<String>The camera profile last applied from the GUI, highlighted on reopen.
thumbwheel_sensitivity: Option<ThumbwheelSensitivity>Per-device thumb-wheel sensitivity override. None falls back to the
app-wide
AppSettings::thumbwheel_sensitivity.
invert_scroll: boolInvert this device’s scroll-wheel direction relative to the OS setting
(issue #126): on, a wheel tick scrolls the opposite way, so a user who
keeps macOS “natural scrolling” for the trackpad can have a traditional
“reverse” wheel on the mouse. Vertical only; the agent applies it through
the device’s HID++ native wheel-inversion mode when supported. false
(default) is the native direction, and is omitted from config.toml.
scroll_resolution: Option<ScrollResolution>Persisted HID++ 0x2121 wheel resolution. None leaves the device’s
current resolution unmanaged and omits the field from config.toml.
host_switch_targets: Vec<String>Physical config keys of pointing devices that follow this keyboard’s host switch channel. The relationship is keyboard-initiated: pressing one of this device’s host keys switches every listed target first, then lets the keyboard leave the current host.
fn_lock: Option<bool>Keyboard Fn-lock state (HID++ fn inversion, 0x40a2/0x40a3): true
means the F-row sends F1–F12 without holding Fn. The state lives in
device RAM per host, so the agent re-applies it on reconnect like
Self::dpi. None means “never set — leave the keyboard alone”.
Implementations§
Source§impl DeviceConfig
impl DeviceConfig
Sourcepub fn effective_dpi(&self, route_key: &str) -> Option<Dpi>
pub fn effective_dpi(&self, route_key: &str) -> Option<Dpi>
Pointer resolution on route_key: the link’s override when the user
set one there, else the device-level value.
Sourcepub fn effective_invert_scroll(&self, route_key: &str) -> bool
pub fn effective_invert_scroll(&self, route_key: &str) -> bool
Native wheel inversion on route_key: the link’s override when the
user set one there, else the device-level value.
Sourcepub fn effective_scroll_resolution(
&self,
route_key: &str,
) -> Option<ScrollResolution>
pub fn effective_scroll_resolution( &self, route_key: &str, ) -> Option<ScrollResolution>
Wheel resolution on route_key: the link’s override when the user set
one there, else the device-level value.
Sourcepub fn effective_lighting(&self, route_key: &str) -> Option<&Lighting>
pub fn effective_lighting(&self, route_key: &str) -> Option<&Lighting>
Lighting on route_key: the link’s override when the user set one
there, else the device-level value.
Sourcepub fn effective_smartshift(&self, route_key: &str) -> Option<SmartShift>
pub fn effective_smartshift(&self, route_key: &str) -> Option<SmartShift>
SmartShift on route_key: the link’s override when the user set one
there, else the device-level value.
Sourcepub fn holds_settings(&self) -> bool
pub fn holds_settings(&self) -> bool
Whether this entry carries anything the user configured, as opposed
to nothing but the metadata OpenLogi writes on its own: the probed
Self::identity and the Self::links route index.
This is what lets Config::resolve_device_key tell a bare entry
created by an identity probe from a pre-upgrade entry holding real
bindings and DPI. Comparing a stripped clone against Default,
rather than testing fields one by one, keeps the answer honest as the
struct grows: a setting added tomorrow counts from the day it exists,
with nothing here to remember to update.
Trait Implementations§
Source§impl Clone for DeviceConfig
impl Clone for DeviceConfig
Source§fn clone(&self) -> DeviceConfig
fn clone(&self) -> DeviceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more