Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f31a23c
fix(keyboards): show Logitech performance when controls are available
ruvelro Nov 30, 2026
c7eaa1e
Add LIGHTSYNC key, zone and inactivity controls
ruvelro Nov 30, 2026
577c163
Account for LIGHTSYNC controls in the combined bundle
ruvelro Nov 30, 2026
c6b44ed
Use Spanish labels for Logitech lighting actions
ruvelro Nov 30, 2026
a31787d
Describe the lighting off timeout without assuming a firmware timeline
ruvelro Nov 30, 2026
2c12f77
Translate the existing lighting controls into Spanish
ruvelro Nov 30, 2026
f7aef5b
Record the verified LIGHTSYNC bundle size
ruvelro Nov 30, 2026
b9b7359
Unify Logitech lighting controls and add startup colors and presets
ruvelro Dec 1, 2026
1d32514
Set measured budgets for the expanded Logitech lighting panel
ruvelro Dec 1, 2026
b903770
Align labels and controls in Logitech lighting cards
ruvelro Dec 1, 2026
45be33a
Record final lighting panel bundle measurements
ruvelro Dec 1, 2026
2dc79f2
Keep Logitech overview and lighting visible during capability reads
ruvelro Dec 1, 2026
bf786fa
Retry keyboard capability discovery from the workspace
ruvelro Dec 1, 2026
16c4759
Identify G915 logo and keep incomplete lighting controls visible
ruvelro Dec 1, 2026
19eebef
Record the measured bundle size for LIGHTSYNC reliability changes
ruvelro Dec 1, 2026
25fe05c
feat(keyboards): expose Logitech LIGHTSYNC effects and speed
ruvelro Dec 1, 2026
56765b6
feat(keyboards): add Logitech wave variants and key trail
ruvelro Dec 1, 2026
ae2b7b6
feat(keyboards): expose Logitech per-key effects and circular rainbow
ruvelro Dec 1, 2026
14aee85
feat(keyboards): edit G915 game mode and onboard profiles
ruvelro Dec 3, 2026
d8e08a0
chore(build): account for the G915 receiver compatibility fixes
ruvelro Dec 3, 2026
8974d2e
fix(lightsync): include modifier keys in the G915 key trail
ruvelro Dec 3, 2026
3edd425
Merge remote-tracking branch 'origin/main' into pr-1724
onyxhq-dev Dec 3, 2026
f48d470
build: raise the main chunk budget for shared LIGHTSPEED and the G915…
onyxhq-dev Dec 3, 2026
812488f
Merge remote-tracking branch 'origin/main' into pr-1724
onyxhq-dev Dec 3, 2026
057a141
build: raise the JS budget for the G915 X TKL editor on top of shared…
onyxhq-dev Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions build/check-bundle-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,22 @@ export const BUDGET_BYTES: Record<string, number> = {
// add 119,659 bytes of JS (4,571,082 -> 4,690,741 measured); CSS unchanged,
// main grew 38,256 bytes to 1,683,408, below its cap. 4.8 MB leaves room for
// one more protocol release.
".css": 188_000,
".js": 4_800_000,
// G915 X LIGHTSYNC rows and palette measured 189,344 bytes of CSS.
// LIGHTSYNC zone editing, inactivity controls and their translations bring
// the integrated build with shared LIGHTSPEED support to 4,609,301 bytes.
// Host RGB power handling, startup colors and their controls bring that build to 4,622,972 bytes.
// Verified LIGHTSYNC mode changes, retries and the named G915 zones measured 4,626,450 bytes.
// LIGHTSYNC effect periods, ripple and translated LED labels measured 4,633,479 bytes with shared LIGHTSPEED.
// Wave directions, Aurora and the key trail brought the integrated bundle to 4,646,980 bytes.
// The lazy per-key effects panel, circular animation and translations measured 4,653,778 bytes.
// The G915 X TKL Game Mode editor, HID++ commands and translations add about 12 kB.
// The G915 X TKL onboard editor, filesystem and translations measure about 19 kB more.
// Onboard lighting targets, key assignments and animation editing measure 4,717,327 bytes in the integrated build.
// The G915 C547 wake and endpoint fixes bring the integrated bundle to 4,720,034 bytes.
".css": 190_000,
// 2026-12-03: shared LIGHTSPEED (#1651) plus the G915 X TKL editor (#1724)
// measured 4,805,489 bytes of JS together; main 1,726,831 bytes.
".js": 4_900_000,
};

// main-*.js measured 1,511,619 bytes right after the split (posthog ~377 kB
Expand All @@ -101,10 +115,12 @@ export const BUDGET_BYTES: Record<string, number> = {
// recorder, R1 SE button assignment and macro editor, their strings) grow main
// by 45,521 bytes to 1,642,508, past 1.6 MB: the cards and strings load with
// the main chunk. 1.7 MB until the panels move behind dynamic import().
// The G915 X TKL onboard entry points and English strings bring main to about 1,703,507 bytes.
// The extended G915 X TKL onboard entry points and strings bring main to 1,707,098 bytes.
// 2026-12-03: shared LIGHTSPEED receivers (#1651) discover each C547 pairing
// slot at startup, so the slot devices and their retry live in main: measured
// 1,700,309 bytes with protocol 0.64.0 and keyboard-protocol 1.9.0. 1.75 MB
// also covers the G915 X TKL editor wiring (#1724).
// also covers the G915 X TKL editor wiring (#1724): 1,710,641 bytes.
export const MAIN_CHUNK_BUDGET_BYTES = 1_750_000;

export const ASSETS = join("dist", "assets");
Expand Down
6 changes: 6 additions & 0 deletions public/devices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,9 @@ no colour, keycaps, legends or shading carried over. It is committed at
`public/devices/unknown-keyboard.png` and served from the repo until a
maintainer uploads it to the bucket; then drop its `LOCAL_OVERRIDES` entry in
`src/shared/device-images.ts` and point the tests at `CDN + "unknown-keyboard.png"`.


`logitech-g915-x-tkl.png` is the [black G915 X LIGHTSPEED TKL product render](https://resource.logitechg.com/content/dam/gaming/en/products/g915-x-lightspeed-tkl/gallery/g915-x-tkl-wireless-keyboard-gallery-1-us.png)
from Logitech G. The local preview uses the official CDN's transparent trim
at 900 pixels wide. Use the existing artwork upload workflow when preparing
the upstream contribution.
Binary file added public/devices/logitech-g915-x-tkl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/device/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3017,7 +3017,7 @@ export function closeInterfaceSettings(): void {
export function setWorkspaceTab(tab: WorkspaceTab): void {
activeWorkspaceTab = tab;
// A command confirmation belongs to the tab it was made on; an error stays until the next command.
if (keyboardStatusText && [st("kb.updated"), st("kb.sent"), st("kb.writeOnly")].includes(keyboardStatusText)) keyboardStatusText = null;
if (keyboardStatusText && [st("kb.updated"), st("kb.sent"), st("kb.writeOnly"), st("common.done")].includes(keyboardStatusText)) keyboardStatusText = null;
emit();
}

Expand Down Expand Up @@ -3813,6 +3813,12 @@ export function keyboardSession(): unknown {
return activeKeyboard;
}

export async function paintLogitechZones(session: unknown, colors: Extract<KeyboardCommand, { kind: "logitechLiveZones" }>["colors"], wake = true): Promise<void> {
const client = activeKeyboard;
if (client?.family !== "logitech" || client !== session) throw new Error("The Logitech keyboard is no longer active.");
await client.command({ kind: "logitechLiveZones", colors, wake });
}

/** Runs a command on the active keyboard; with `session`, only while that keyboard is still the active one. */
export async function runKeyboardCommand(command: KeyboardCommand, session?: unknown): Promise<boolean> {
const client = activeKeyboard;
Expand Down Expand Up @@ -3843,10 +3849,10 @@ export async function runKeyboardCommand(command: KeyboardCommand, session?: unk
}
if (!telemetry) keyboardStatusText = command.kind === "caps" || command.kind === "direct" || command.kind === "steelseriesColor"
? st("kb.sent")
: command.kind === "razerEffect" || command.kind === "logitechRgbEffect" || command.kind === "logitechSolidColor"
: command.kind === "razerEffect" || command.kind === "logitechRgbEffect" || command.kind === "logitechSolidColor" || command.kind === "logitechZoneColors"
|| (command.kind.startsWith("glorious") && command.kind !== "gloriousUnlock")
? st("kb.writeOnly")
: st("kb.updated");
: st(command.kind.startsWith("logitechOnboard") || command.kind === "logitechGameModeKeys" ? "common.done" : "kb.updated");
return true;
} catch (error) {
if (activeKeyboard !== client) return false;
Expand Down
2 changes: 2 additions & 0 deletions src/device/keyboard-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { GloriousCommand, GloriousWorkspace } from './glorious-workspace.ts
import type { MchoseCommand, MchoseWorkspace } from './mchose-workspace.ts';
import type { WuqueGlobalState, WuqueKeyState, WuqueLightingState } from '@openmouse/keyboard-protocol/drivers';
import type { KeyboardStatus } from '@openmouse/keyboard-protocol/drivers';
import type { LogitechOnboardMemory } from '@openmouse/keyboard-protocol/logitech';
import type { WuqueMacroRead, WuqueHidClient } from '@openmouse/keyboard-protocol/drivers/wuque/hid';
import type { WuqueAxisReading, WuqueHigherKey, WuqueHigherKeyWrite, WuqueKeyLayoutStyle, WuqueKeyLayoutDefault, WuqueLightingBase, WuqueLightingLed, WuqueLightingPaletteColor, WuqueMacroEvent, WuqueRgb } from '@openmouse/keyboard-protocol/wuque';
import type { WootingAkcPayloadWrite, WootingRapidTriggerTarget, WootingRgbColors, WootingRgbCore, WootingRgbCoreWrite } from '@openmouse/keyboard-protocol/wooting';
Expand All @@ -22,6 +23,7 @@ export interface KeyboardWorkspace {
wooting?: KeyboardStatus | null;
/** Status returned by a Razer, Logitech or SteelSeries keyboard. */
vendorStatus?: KeyboardStatus | null;
logitechOnboard?: LogitechOnboardMemory;
razerGameModeLed?: boolean | null;
/** Typed RGB core and color pages; raw `wooting.rgb` stays for diagnostics. */
wootingRgb?: WootingRgbView | null;
Expand Down
15 changes: 15 additions & 0 deletions src/device/logitech-game-mode-storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function readLogitechGameModeSelection(deviceId: string | null, controls: readonly number[]): number[] | null {
if (!deviceId) return null;
try {
const stored: unknown = JSON.parse(localStorage.getItem(`openmouse:logitech:game-mode:${deviceId}`) ?? "null");
if (Array.isArray(stored)) return stored.filter((id): id is number => typeof id === "number" && id !== 0 && controls.includes(id));
} catch {
// Browser storage is optional.
}
return null;
}

export function saveLogitechGameModeSelection(deviceId: string | null, selection: readonly number[]): void {
if (!deviceId) return;
try { localStorage.setItem(`openmouse:logitech:game-mode:${deviceId}`, JSON.stringify(selection)); } catch { /* Optional browser storage. */ }
}
52 changes: 48 additions & 4 deletions src/device/logitech-keyboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ test("Logitech adapter accepts keyboard HID++ only, never mouse product IDs", ()
test("Initial refresh exposes actual Logitech status and identity without extra read", async () => {
const client = new LogitechKeyboardClient(device);
const current = status();
let reads = 0;
driverOf(client).readStatus = async () => { reads += 1; return current; };
const reads: unknown[] = [];
driverOf(client).readStatus = async (options?: unknown) => { reads.push(options); return current; };
assert.deepEqual(await client.readIdentity(), {
brand: "Logitech", name: "PRO X 60", firmwareVersion: "1.2", serial: "ABC",
boardId: null, capabilities: null, appVersion: null, pcbVersion: null,
});
assert.deepEqual(await client.readPolling(), { currentHz: 1000, supportedHz: [125, 1000] });
assert.equal((await client.command({ kind: "refresh" })).vendorStatus, current);
assert.equal(reads, 1);
assert.deepEqual(reads, [undefined]);
assert.equal((await client.command({ kind: "logitechRefresh" })).vendorStatus, current);
assert.equal(reads, 2);
assert.deepEqual(reads, [undefined, { refreshFeatures: true }]);
});

test("Status-gated writes use the protocol's verified methods then reread status", async () => {
Expand Down Expand Up @@ -87,3 +87,47 @@ test("Unadvertised RGB modes and unavailable analog state never write", async ()
await assert.rejects(client.command({ kind: "logitechRapidTrigger", enabled: true }), /not available/);
await assert.rejects(client.command({ kind: "logitechRgbEffect", mode: "Cycling" }), /not advertised/);
});

test("Lighting writes target the advertised cluster, addressable keys and firmware timers", async () => {
const client = new LogitechKeyboardClient(device);
const current = status();
const lighting = current.logitech?.lighting;
assert.ok(lighting);
const calls: unknown[][] = [];
const inner = driverOf(client);
inner.readStatus = async () => current;
for (const method of ["setRgbEffect", "setRgbTimers", "setZoneColors"]) {
inner[method] = async (...args: unknown[]) => { calls.push([method, ...args]); };
}
const effect = { kind: "logitechRgbEffect", mode: "Wave", cluster: 0, target: "idle", periodMs: 3120 } as const;
const timers = { dimAfterSeconds: 30, offAfterDimSeconds: null };
await assert.rejects(client.command(effect), /did not report inactivity settings/);
await assert.rejects(client.command({ kind: "logitechRgbTimers", timers }), /did not report inactivity settings/);
lighting.timers = { dimAfterSeconds: 60, offAfterDimSeconds: 300 };
await assert.rejects(client.command({ ...effect, cluster: 1 }), /not advertised/);
await client.command(effect);
const colors = [{ zone: 2, red: 5, green: 10, blue: 20 }];
await client.command({ kind: "logitechZoneColors", colors });
await client.command({ kind: "logitechRgbTimers", timers });
assert.deepEqual(calls, [
["setRgbEffect", "Wave", undefined, 3120, { cluster: 0, target: "idle" }],
["setZoneColors", colors],
["setRgbTimers", timers],
]);
});

test("Logitech startup settings require readable device colors and preserve both values", async () => {
const client = new LogitechKeyboardClient(device);
const current = status();
const lighting = current.logitech?.lighting;
assert.ok(lighting);
const inner = driverOf(client);
inner.readStatus = async () => current;
const settings = { enabled: true, primary: { red: 0, green: 255, blue: 255 }, secondary: { red: 128, green: 0, blue: 255 } };
const writes: unknown[] = [];
inner.setStartupLighting = async (value: unknown) => { writes.push(value); };
await assert.rejects(client.command({ kind: "logitechStartupLighting", settings }), /did not report two-color/);
lighting.startup = settings;
await client.command({ kind: "logitechStartupLighting", settings });
assert.deepEqual(writes, [settings]);
});
Loading