Fix Clevo keyboard LED mapping for per-key RGB control#76
Open
Dronakurl wants to merge 2 commits intoCalcProgrammer1:masterfrom
Open
Fix Clevo keyboard LED mapping for per-key RGB control#76Dronakurl wants to merge 2 commits intoCalcProgrammer1:masterfrom
Dronakurl wants to merge 2 commits intoCalcProgrammer1:masterfrom
Conversation
The KeyboardLayoutManager returns LED names with "Key: " prefix (e.g., "Key: W") but the hardware value lookup was checking for just "W", causing all keys to map to hardware LED 0 (Left Ctrl). Added GetCorrectHWValue() function that properly maps all 126 keys including: - Standard keyboard keys (F-row, number row, QWERTY, etc.) - Arrow keys (Up/Left/Down/Right Arrow) - Numpad keys (Number Pad 0-9, /, *, -, +, ., Enter) This fixes per-key RGB control on Clevo ITE 8291 keyboards. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> refactor: remove redundant GetCorrectHWValue function The Clevo keyboard controller had duplicate hardware LED value mappings in both clevo_tkl_values array and GetCorrectHWValue(). This removes the ~100 if-statement function and uses KeyboardLayoutManager.GetKeyValueAt() directly, aligning with the pattern used by other keyboard controllers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Revert "refactor: remove redundant GetCorrectHWValue function" This reverts commit afe1141. refactor: replace GetCorrectHWValue if-statements with unordered_map Replace ~100 if-statements in GetCorrectHWValue() with a static unordered_map for O(1) hash lookup instead of O(n) string comparisons. This improves: - Performance: O(1) vs O(n) lookup - Maintainability: single map definition vs scattered if-statements - Readability: compact data structure vs verbose code The mapping is still required because Clevo hardware LED positions don't match standard keyboard matrix order. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This helper script converts OpenRGB .orp profile files to the Linux
kernel LED interface format used by the tuxedo_keyboard driver.
Purpose:
On TUXEDO/Clevo laptops, the Embedded Controller (EC) can turn off the
keyboard backlight after idle periods. When it wakes, it uses firmware
defaults instead of OpenRGB's USB HID settings. The kernel LED interface
may provide better persistence through EC wake cycles.
Features:
- Parses OpenRGB .orp profile binary format
- Uses the same hardware LED mapping as RGBController_ClevoKeyboard
- Applies colors to /sys/class/leds/rgb:kbd_backlight_*/multi_intensity
- Works with any OpenRGB profile (specify profile name as argument)
Usage:
python3 tuxedo_keyboard_interface_helper.py [profile_name]
Hardware Compatibility:
- TUXEDO laptops with Clevo per-key RGB keyboards (ITE 8291 controller)
- Linux with tuxedo_keyboard kernel driver
- NOT part of OpenRGB itself - external helper utility
Related:
- Addresses EC timeout persistence issue
- Complements Clevo keyboard support (PR CalcProgrammer1#76)
- See: https://gitlab.com/tuxedocomputers/development/packages/tuxedo-keyboard
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Author
Additional Helper for TUXEDO HardwareI've created a helper script that converts OpenRGB profiles to the kernel LED interface used by the Why This ExistsOn TUXEDO laptops, the Embedded Controller (EC) can turn off the keyboard backlight after idle periods. When it wakes, it reverts to firmware defaults instead of OpenRGB's USB HID settings. The kernel LED interface ( The Helper ScriptLocation: Features:
Usage: python3 tuxedo_keyboard_interface_helper.py [profile_name]Hardware Compatibility
TestingTested on TUXEDO Stellaris 16 Intel Gen6 with per-key RGB (126 zones). The script successfully:
Next step: EC timeout persistence test to verify if kernel interface colors survive EC wake. |
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.
This PR fixes the broken per-key RGB control on Clevo ITE 8291 keyboards found in TUXEDO/Clevo laptops.
Problem
The KeyboardLayoutManager returns LED names with a "Key: " prefix (e.g., "Key: W", "Key: F1") but the hardware value lookup in the Clevo controller was using
KeyboardLayoutManager.GetKeyValueAt()which expects bare key names. This mismatch caused incorrect key-to-LED mapping, making per-key RGB lighting non-functional.When attempting to set colors on individual keys, the wrong key would light up. For example, selecting the W key in OpenRGB would actually light up the I key on the keyboard. The mapping was completely broken.
Solution
Added a
GetCorrectHWValue()function that properly maps all 126 keyboard LEDs from their full key names to the correct hardware LED values. The function uses anunordered_mapfor hash lookup instead of the previous broken approach.The mapping covers:
Hardware Information
This fix was tested on:
Testing
After applying this fix, per-key RGB control works correctly. Each key now maps to its proper hardware LED position, allowing individual key color customization through the OpenRGB UI.
Changes
RGBController_ClevoKeyboard.cpp: AddedGetCorrectHWValue()function with full key mappingRGBController_ClevoKeyboard.h: Added function declarationClevoKeyboardDevices.cpp: Reorganized comments for clarity