A lightweight controller for complete control over all 24 RGB zones of Lenovo Legion LOQ series keyboards.
- Granular Control: 24 RGB zones with independent control
- High Performance: Low-latency updates for smooth animations up to 60 FPS with Rust backend and high-frequency FFI callbacks
- Minimal Footprint: Native XAML compositor reduces memory from ~200MB to ~40MB with startup times under 500ms
- Modular Architecture: Build and integrate custom lighting presets in Rust
- System Tray Integration: Background operation, minimize to tray, menu options
- Global Hotkey: Configurable system-wide hotkey for preset cycling
- Direct USB HID Control: Native hardware communication
Static Effects
- Static Color
- Color Breath
- Pulse Center
- Aurora
- Nebula
- Chromatic Breath
- Sparkle Dynamic Effects
- Rainbow Breath, Rainbow Cycle, Rainbow Wave
- Color Wheel, Color Sweep
- Color Scan
- Horse Color, Horse Cycle
- Ferrari RPM Reactive Effects
- Screen Ambiance
- Audio Sparkle, Audio Sparkle Rainbow, Audio Sparkle Media
- Audio Ripple
- Typing Rainbow Ripple System Monitoring
- CPU/Memory/GPU Usage Status
- .NET 8 SDK
- Rust & Cargo (MSVC toolchain)
- Visual Studio 2022 or Build Tools with Windows App SDK workload
# Clone and navigate to repository
git clone https://github.com/DChitale/LOQ-24-zone-RGB-controller
cd LOQ-24-zone-RGB-controller
# Run build script (compiles Rust DLL and C# app)
powershell -ExecutionPolicy Bypass -File build.ps1RGBController\bin\x86\Release\net8.0-windows10.0.26100.0\win-x86\RGBController.exeLocation: RGBController/
- Technology: WinUI 3 (XAML/C#), .NET 8
- Main Shell: MainWindow.xaml - Application entry point and layout
- Visual Canvas: HomePage.xaml - Win2D CanvasControl with rendering pipeline
- Interop Layer: RgbInterop.cs - P/Invoke bindings for Rust DLL communication
Location: rust-backend/
- FFI Entry Point: lib.rs - Compiles to rgb_backend.dll, exposes C# callable functions
- Hardware Driver: led_driver.rs - USB HID communication and LED protocol
- Effect System: presets/ - Modular effect implementations
RGBController/bin/x86/Release/net8.0-windows10.0.26100.0/win-x86/
Effects are implemented as Rust modules in the presets system. Each effect implements the Effect trait and can accept configurable parameters (speed, density, size, colors).
Create a new file under rust-backend/src/presets/:
// rust-backend/src/presets/my_custom_effect.rs
use crate::effect::{Effect, EffectConfig};
pub struct MyCustomEffect;
impl Effect for MyCustomEffect {
fn name(&self) -> &str {
"My Custom Effect"
}
fn update(&mut self, config: &EffectConfig) -> Vec<[u8; 3]> {
// Return RGB values for each of 24 zones
vec![[255, 0, 0]; 24] // Example: all red
}
}Add to rust-backend/src/presets/mod.rs:
pub mod my_custom_effect;In presets/mod.rs, add preset configuration:
PresetMetadata {
id: "my_custom_effect",
name: "My Custom Effect",
has_speed: true,
has_density: true,
has_size: false,
has_color: true,
colors: vec![(255, 0, 0)], // Default colors
}In rust-backend/src/lib.rs, add to rgb_set_preset() match block:
"my_custom_effect" => {
let mut effect = my_custom_effect::MyCustomEffect;
// Effect loop implementation
}- Speed: Effect animation speed (0-100)
- Density: Effect intensity/frequency (0-100)
- Size: Effect scale/spread (0-100)
- Color: RGB values for customization
Build Fails - Rust Not Found
- Ensure Rust is installed via rustup with MSVC toolchain
- Run:
rustup toolchain install stable-msvcDLL Not Loading - Verify rgb_backend.dll exists in output directory
- Check Visual C++ redistributables are installed No LED Response
- Ensure Lenovo Legion LOQ keyboard is connected
- Try manual USB HID device enumeration in Device Manager
MIT License - See LICENSE file for details.
LOQ 15AHP10 Legion 5 15AHP10 Supports all 24 zone rgb keyboard laptop by Lenovo.
