Skip to content

fix(hid): solid keyboard colour via 0x8070 effect#205

Open
davidbudnick wants to merge 2 commits into
AprilNEA:masterfrom
davidbudnick:fix/keyboard-mouse-lighting
Open

fix(hid): solid keyboard colour via 0x8070 effect#205
davidbudnick wants to merge 2 commits into
AprilNEA:masterfrom
davidbudnick:fix/keyboard-mouse-lighting

Conversation

@davidbudnick

@davidbudnick davidbudnick commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Context

  • keyboard wouldn't hold a solid colour — per-key 0x8080 can't override the G-series onboard effect
  • so set_keyboard_color now prefers 0x8070 ColorLedEffects (fixed effect, RAM-only), falls back to 0x8080
  • lighting tab now shows for keyboards exposing either 0x8070 or 0x8080

Testing

  • set red/green/blue on a wired G513 via openlogi diag lighting — solid, confirmed on hardware
  • cargo test + clippy + fmt clean

Screen

Screenshot 2026-06-10 at 2 42 22 PM Screenshot 2026-06-10 at 2 42 26 PM Screenshot 2026-06-10 at 2 42 30 PM

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown

Greptile Summary

Adds ColorLedEffects (0x8070) as the preferred solid-colour path for G-series keyboards, falling back to PerKeyLighting (0x8080) when absent. The fix addresses the root cause: the firmware's running onboard profile can't be overridden by per-key writes, but the effect engine can.

  • set_keyboard_color now delegates to set_keyboard_color_with(Auto, …), which tries 0x8070 first and falls back to 0x8080 only on a FeatureUnsupported for 0x8070 — other errors propagate unchanged.
  • set_color_effects loops over up to 4 zones with an 8 ms inter-report gap; stores in RAM only, relying on the orchestrator's device-arrival reapply for persistence across reboots.
  • The Capabilities::lighting flag now covers both 0x8070 and 0x8080; the --method CLI flag lets diag lighting force a specific path for A/B testing.

Confidence Score: 5/5

Safe to merge — the new 0x8070 path is RAM-only and hardware-confirmed, and the fallback to 0x8080 is correctly gated to the specific FeatureUnsupported case.

The Auto fallback correctly distinguishes device-has-no-0x8070 from any other error, so no existing 0x8080-only devices will regress. The 0x8070 writes are fire-and-forget HID output reports with no new error-handling edge cases. All changes are backward-compatible and confirmed on a G513.

No files require special attention.

Important Files Changed

Filename Overview
crates/openlogi-hid/src/write.rs Core change: adds set_color_effects (0x8070), set_keyboard_color_with, LightingMethod enum, and shared resolve_feature_index helper; Auto fallback logic correctly distinguishes 0x8070-absent from other errors via feature_hex guard
crates/openlogi-core/src/device.rs LIGHTING capability detection now includes 0x8070 alongside 0x8080; comment updated to reflect that both features are driven by set_keyboard_color
crates/openlogi-hid/src/lib.rs Public re-exports updated to expose LightingMethod and set_keyboard_color_with; no logic changes
crates/openlogi-cli/src/cmd/diag/lighting.rs Adds --method CLI argument mapping to LightingMethod; routes through set_keyboard_color_with instead of the bare set_keyboard_color

Reviews (2): Last reviewed commit: "docs(hid): fix set_color_effects RAM-onl..." | Re-trigger Greptile

Comment thread crates/openlogi-hid/src/write.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant