Supported HID++ Features in OpenLogi: Complete Registry and Implementation Guide
OpenLogi supports over 40 HID++ 2.0 protocol features—including DPI adjustment, SmartShift, per-key RGB lighting, and battery monitoring—implemented as Rust modules under crates/openlogi-hidpp/src/ with traits for instantiation, event handling, and device communication.
OpenLogi provides a comprehensive open-source implementation of the Logitech HID++ 2.0 protocol, enabling programmatic control of advanced Logitech peripherals through discrete feature modules. Each supported capability is encapsulated in its own source file within the openlogi-hidpp crate, with the central registry and trait definitions located in crates/openlogi-hidpp/src/feature.rs.
Complete Registry of Supported HID++ Features
The following HID++ features are fully implemented and accessible through the OpenLogi library. Each feature resides in a dedicated Rust module at crates/openlogi-hidpp/src/<feature_name>.rs.
Input and Navigation Control
adjustable_dpi— Dynamic DPI adjustment withcrates/openlogi-hidpp/src/adjustable_dpi.rsextended_dpi— Extended DPI range support viaextended_dpi.rshires_wheel— High-resolution scroll wheel handling inhires_wheel.rsvertical_scrolling— Traditional scroll wheel management invertical_scrolling.rscrown— Logitech Crown (smart dial) integration incrown.rsthumbwheel— Thumb-wheel input processing inthumbwheel.rssmartshift— Automatic DPI/polling rate cycling insmartshift.rssmartshift_enhanced— Advanced SmartShift algorithms insmartshift_enhanced.rsmouse_pointer— Pointer configuration and control inmouse_pointer.rsgestures2— Second-generation gesture recognition ingestures2.rstouch_mouse_raw— Raw touch-mouse data streams intouch_mouse_raw.rstouchpad_raw_xy— Raw touchpad coordinate data intouchpad_raw_xy.rs
Key Remapping and Configuration
reprog_controls— Control remapping logic inreprog_controls.rspersistent_remappable_action— Persistent key action assignments inpersistent_remappable_action.rsdisable_keys— Individual key disabling functionality indisable_keys.rsdisable_keys_by_usage— Usage-page-based key disabling indisable_keys_by_usage.rsfn_inversion— Function-key inversion toggles infn_inversion.rs
Lighting and Illumination
backlight— Keyboard backlight control inbacklight.rsillumination— General illumination handling inillumination.rsper_key_lighting— Per-key RGB lighting effects inper_key_lighting.rsrgb_effects— Standard RGB lighting patterns inrgb_effects.rscolor_led_effects— Advanced LED effect processing incolor_led_effects.rsbrightness_control— Display brightness adjustment inbrightness_control.rs
Power and Battery Management
battery_status— Charging/discharging state monitoring inbattery_status.rsbattery_voltage— Millivolt-level voltage reporting inbattery_voltage.rsunified_battery— Multi-device battery aggregation inunified_battery.rssolar_dashboard— Solar charging telemetry insolar_dashboard.rs
Device Configuration and Host Management
root— Root feature for basic device operations inroot.rsfeature_set— Device capability querying infeature_set.rsdevice_information— General device metadata indevice_information.rsdevice_type_and_name— Hardware identification indevice_type_and_name.rsdevice_friendly_name— User-configurable device naming indevice_friendly_name.rschange_host— Host-switching between computers inchange_host.rshosts_info— Paired host information retrieval inhosts_info.rsdual_platform— macOS/Windows dual-mode support indual_platform.rsmulti_platform— Multi-platform compatibility handling inmulti_platform.rsmode_status— Current device state reporting inmode_status.rswireless_device_status— Connection quality monitoring inwireless_device_status.rsreport_rate— Polling rate configuration inreport_rate.rsextended_report_rate— High-frequency polling up to 8000Hz inextended_report_rate.rs
Audio and Haptic Feedback
equalizer— Audio equalizer control inequalizer.rssidetone— Microphone sidetone adjustment insidetone.rshaptic_feedback— Haptic motor control inhaptic_feedback.rs
Core Architecture and Traits
Feature Traits and Registry
Every HID++ feature in OpenLogi implements the Feature trait as a marker interface. Features supporting automatic instantiation implement CreatableFeature, which provides:
- A static
IDconstant (the HID++ feature ID) - A
STARTING_VERSIONconstant (protocol version) - A
newconstructor accepting anArc<HidppChannel>, device index, and feature index
The central registry in crates/openlogi-hidpp/src/feature.rs (lines 61-96) defines FeatureType bitflags describing feature metadata such as obsolescence, hidden, or engineering status. Global feature registration is handled by crates/openlogi-hidpp/src/registry.rs.
Communication Endpoints
Features communicate through a FeatureEndpoint that constructs HID++ request headers and manages protocol-level transactions. The endpoint exposes:
call— For short (8-byte) HID++ messagescall_long— For long (20-byte) HID++ messages
Event-Driven Architecture
Features emitting unsolicited hardware events implement EmittingFeature<T> and utilize an EventSource<E> to decode broadcast payloads. The event_payload method parses raw HID++ event packets into structured Rust types, enabling asynchronous reactive programming patterns.
Practical Usage Examples
Instantiating Event-Driven Features
The following example demonstrates creating a SmartShift feature instance and listening for status events:
use std::sync::Arc;
use openlogi_hidpp::{channel::HidppChannel, feature::smartshift::SmartShift};
async fn example(chan: Arc<HidppChannel>, dev_idx: u8, feat_idx: u8) {
// SmartShift implements CreatableFeature
let smartshift = SmartShift::new(chan.clone(), dev_idx, feat_idx);
// The feature emits `SmartShiftEvent`s – get a receiver
let mut rx = smartshift.listen();
// Process events in an async loop
while let Ok(event) = rx.recv_async().await {
println!("SmartShift event: {:?}", event);
}
}
Configuring DPI Settings
Adjust sensor resolution using the AdjustableDpi feature:
use openlogi_hidpp::feature::adjustable_dpi::AdjustableDpi;
async fn set_dpi(chan: Arc<HidppChannel>, dev: u8, feat: u8, dpi: u16) {
let dpi_feature = AdjustableDpi::new(chan, dev, feat);
// `set_dpi` is a short‑report call (example API)
dpi_feature.set_dpi(dpi).await.expect("failed to set DPI");
}
Reading Battery Telemetry
Query hardware voltage levels through the BatteryVoltage feature:
use openlogi_hidpp::feature::battery_voltage::BatteryVoltage;
async fn read_voltage(chan: Arc<HidppChannel>, dev: u8, feat: u8) {
let bat = BatteryVoltage::new(chan, dev, feat);
let volts = bat.read_voltage().await.unwrap();
println!("Battery voltage: {} mV", volts);
}
Summary
- OpenLogi implements 40+ HID++ 2.0 features covering input control, lighting, power management, and device configuration.
- All feature modules reside in
crates/openlogi-hidpp/src/with the central registry defined infeature.rs. - Features use the
CreatableFeaturetrait for instantiation andEmittingFeature<T>for event streams. - Communication occurs through
FeatureEndpointwithcallandcall_longmethods for short and long HID++ messages. - High-level device APIs in
crates/openlogi-device/src/write/*.rsultimately delegate to these HID++ feature implementations.
Frequently Asked Questions
What is the HID++ 2.0 protocol used by OpenLogi?
HID++ 2.0 is Logitech's proprietary extension to the USB HID protocol, enabling advanced device features like high-resolution scrolling, per-key lighting, and host switching. OpenLogi implements this protocol in Rust, allowing developers to access these capabilities without relying on Logitech's proprietary software.
How do I determine which HID++ features a specific device supports?
Use the feature_set module (crates/openlogi-hidpp/src/feature_set.rs) to query the device's advertised capabilities. This feature returns a bitmap of supported feature IDs, which you can cross-reference against the CreatableFeature::ID constants in the OpenLogi source code.
What is the difference between CreatableFeature and EmittingFeature?
CreatableFeature marks features that can be instantiated directly with a constructor and static ID, such as BatteryVoltage or AdjustableDpi. EmittingFeature<T> extends this capability for hardware that sends unsolicited status updates (like SmartShift or BatteryStatus), providing an async event receiver through the listen() method.
How does OpenLogi handle asynchronous HID++ events?
Event-driven features implement EmittingFeature<T> and use an EventSource<E> to decode event_payload data. The library spawns async tasks that monitor the HID++ channel for broadcast messages, deserializing them into typed Rust events that can be processed through async receivers without blocking the main execution thread.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →