Repository navigation
fix(lighting): keyboard backlight, power button, fixed-size preview (focus #28) - #23
Merged
Merged
Conversation
The lighting preview stretched with the window. It is a picture of a keyboard, not a layout, so it now has a fixed 372 px width (the panel's inner width at the window minimum) and sits centered. Verified offscreen at 440, 480 and 720 px windows: 372 px every time. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v
On the m18 R2 the AW-ELC (187c:0551) never touches the keyboard: it drives the lid logo, exhaust lights and power button. The keyboard is a separate Darfon HID device (0d62:aab1) speaking alienfx-tools' "API V5": 64-byte feature reports with ID 0xCC over hidraw. New cryo.hw.keyboard implements reset/status, colour blocks (wire id = index + 1, 15 per packet, exactly report length), loop/update and global brightness, and mirrors the chassis effect as a solid colour (quantum = brand cyan). Engine drives both devices independently (one failing never blocks the other), capabilities gain lighting_elc / lighting_keyboard, reapply reopens the hidraw node after resume, and doctor reports the keyboard node and report size. 14 unit tests over fake transports and sysfs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v
Zones 0-3 were the AWCC keyboard default; on the 0551 laptops the ELC drives the rear exhaust rings (0, 1), the lid logo (2) and the power button (4, 5), and id 3 is nothing. Verified on the m18 R2: with 0-3 the rings and lid changed and the power button stayed firmware blue. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v
Probed on the m18 R2 (2026-10-22): zone 4 drives the power button from the normal user animation; zone 3 is a phantom and zone 5 makes the firmware drop the entire animation, which is why the previous 0,1,2,4,5 list changed nothing. Chassis zones are now 0,1,2,4. The controller also layers six power-state animation slots (AC/battery states, opcode 0x22) over the user animation and blends them where a zone is shared, so every effect first programs those slots black for the button. Effects takes an elc_factory for tests; three packet-level tests cover the sequence. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repairs keyboard lighting on the m18 R2, the two halves of focus #28.
Why only the lid changed. On the m16/m18 R1/R2 family the AW-ELC controller (187c:0551) does not drive the keyboard at all. Probed on the m18 R2 on 2026-10-22: ids 0 and 1 are the rear exhaust rings, 2 the lid logo and 4 the power button. Id 3 is a phantom and id 5 is poison (a zone list containing it makes the firmware drop the whole animation). Cryo sent the AWCC keyboard default 0-3, so rings and lid changed and the power button never did.
Changes
hw/effects.py: chassis zones are now 0, 1, 2, 4. Each effect first blanks the controller's six power-state animation slots for the button (opcode 0x22, slots 0x5b-0x60), because those blend on top of the user animation where a zone is shared. This replaces the stock "blue on AC" colour; the setting persists in the controller (AWCC reprograms it on Windows).hw/keyboard.py(new): the keyboard is a separate Darfon HID device (0d62:aab1 here, bab0/bab1 on siblings) speaking alienfx-tools' "API V5" over hidraw: 64-byte feature reports with ID 0xCC (length read from the HID descriptor), reset/status, colour blocks (wire id = index + 1, 15 per packet, exactly report length), loop, update, global brightness. It mirrors the chassis effect as a solid colour (quantum = brand cyan).lighting_elc/lighting_keyboard, reapply reopens the hidraw node after resume, doctor prints the keyboard node and report size and the verdict distinguishes "no lighting at all" from "chassis lighting missing".Verified on hardware (m18 R2, kernel 7.2.8): static amber on rings, lid, power button and all keys; brightness 100; quantum morph on the chassis with cyan keys. 103 tests pass; new packet-level tests for the ELC sequence and the keyboard driver over fake transports.
Closes the two acceptance criteria of focus #28.
🤖 Generated with Claude Code
https://claude.ai/code/session_0137cahar5LBoYMf2fiDkt4v