diff --git a/build/check-bundle-size.ts b/build/check-bundle-size.ts index a0f56b4f..2ffaf55f 100644 --- a/build/check-bundle-size.ts +++ b/build/check-bundle-size.ts @@ -86,8 +86,22 @@ export const BUDGET_BYTES: Record = { // 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 @@ -101,10 +115,12 @@ export const BUDGET_BYTES: Record = { // 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"); diff --git a/public/devices/README.md b/public/devices/README.md index 50bcabab..de952f4c 100644 --- a/public/devices/README.md +++ b/public/devices/README.md @@ -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. diff --git a/public/devices/logitech-g915-x-tkl.png b/public/devices/logitech-g915-x-tkl.png new file mode 100644 index 00000000..46cf3633 Binary files /dev/null and b/public/devices/logitech-g915-x-tkl.png differ diff --git a/src/device/controller.ts b/src/device/controller.ts index fd03b3ff..25b53dd9 100644 --- a/src/device/controller.ts +++ b/src/device/controller.ts @@ -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(); } @@ -3813,6 +3813,12 @@ export function keyboardSession(): unknown { return activeKeyboard; } +export async function paintLogitechZones(session: unknown, colors: Extract["colors"], wake = true): Promise { + 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 { const client = activeKeyboard; @@ -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; diff --git a/src/device/keyboard-workspace.ts b/src/device/keyboard-workspace.ts index 792c09a1..de7b358c 100644 --- a/src/device/keyboard-workspace.ts +++ b/src/device/keyboard-workspace.ts @@ -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'; @@ -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; diff --git a/src/device/logitech-game-mode-storage.ts b/src/device/logitech-game-mode-storage.ts new file mode 100644 index 00000000..a501ff26 --- /dev/null +++ b/src/device/logitech-game-mode-storage.ts @@ -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. */ } +} diff --git a/src/device/logitech-keyboard.test.ts b/src/device/logitech-keyboard.test.ts index 76d1b8db..4c3a15db 100644 --- a/src/device/logitech-keyboard.test.ts +++ b/src/device/logitech-keyboard.test.ts @@ -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 () => { @@ -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]); +}); diff --git a/src/device/logitech-keyboard.ts b/src/device/logitech-keyboard.ts index 2a347cbf..aad84561 100644 --- a/src/device/logitech-keyboard.ts +++ b/src/device/logitech-keyboard.ts @@ -1,6 +1,6 @@ import { LogitechKeyboardHidClient, type LogitechKeyboardReceiverEndpoint } from "@openmouse/keyboard-protocol/drivers/logitech/hid"; import type { KeyboardStatus } from "@openmouse/keyboard-protocol/drivers"; -import { logitechRgbMode, type LogitechRgbMode } from "@openmouse/keyboard-protocol/logitech"; +import { logitechRgbMode, type LogitechAnimation, type LogitechOnboardMemory, type LogitechOnboardProfileChanges, type LogitechRgbColor, type LogitechStartupLighting, type LogitechRgbMode, type LogitechRgbTarget, type LogitechRgbTimers, type LogitechRgbWaveDirection } from "@openmouse/keyboard-protocol/logitech"; import type { KeyboardClient } from "./keyboard-client.ts"; import type { KeyboardCommand, KeyboardWorkspace } from "./keyboard-workspace.ts"; import type { KeyboardIdentityView, KeyboardPollingView } from "./types.ts"; @@ -11,9 +11,20 @@ export type LogitechKeyboardCommand = | { kind: "logitechBrightness"; value: number } | { kind: "logitechRapidTrigger"; enabled: boolean } | { kind: "logitechKeyPriority"; enabled: boolean } - | { kind: "logitechRgbEffect"; mode: LogitechRgbMode } + | { kind: "logitechRgbEffect"; mode: LogitechRgbMode; cluster?: number; target?: LogitechRgbTarget; color?: LogitechRgbColor; intensity?: number; periodMs?: number; direction?: LogitechRgbWaveDirection } + | { kind: "logitechZoneColors"; colors: readonly (LogitechRgbColor & { zone: number })[] } + | { kind: "logitechLiveZones"; colors: readonly (LogitechRgbColor & { zone: number })[]; wake: boolean } + | { kind: "logitechRgbTimers"; timers: LogitechRgbTimers } + | { kind: "logitechStartupLighting"; settings: LogitechStartupLighting } + | { kind: "logitechGameModeKeys"; disabled: readonly number[] } + | { kind: "logitechOnboardRead" } + | { kind: "logitechOnboardAnimationSave"; slot: 0 | 1; expectedName: string | null; animation: LogitechAnimation } + | { kind: "logitechOnboardActivate"; slot: number } + | { kind: "logitechOnboardLeave" } + | { kind: "logitechOnboardSave"; slot: number; revision: number; changes: LogitechOnboardProfileChanges } | { kind: "logitechSolidColor"; red: number; green: number; blue: number }; + /** Keyboard-only HID++ adapter. Unreadable and unadvertised controls remain unavailable. */ export class LogitechKeyboardClient implements KeyboardClient { readonly family = "logitech"; @@ -21,6 +32,7 @@ export class LogitechKeyboardClient implements KeyboardClient { readonly device: HIDDevice; private readonly client: LogitechKeyboardHidClient; private initialStatus: KeyboardStatus | null = null; + private onboard: LogitechOnboardMemory | null = null; constructor(device: HIDDevice, endpoint?: LogitechKeyboardReceiverEndpoint) { this.device = device; @@ -69,8 +81,16 @@ export class LogitechKeyboardClient implements KeyboardClient { return this.readPolling(); } + recoveredWorkspace(): Partial | null { + return this.onboard ? { logitechOnboard: this.onboard } : null; + } + async command(command: KeyboardCommand): Promise> { - if (command.kind === "logitechRefresh" || command.kind === "refresh") { + if (command.kind === "logitechRefresh") { + this.initialStatus = null; + return { vendorStatus: await this.client.readStatus({ refreshFeatures: true }) }; + } + if (command.kind === "refresh") { const status = this.initialStatus ?? await this.client.readStatus(); this.initialStatus = null; return { vendorStatus: status }; @@ -78,9 +98,53 @@ export class LogitechKeyboardClient implements KeyboardClient { if (!command.kind.startsWith("logitech")) throw new Error("Unsupported Logitech keyboard command."); // The workspace command union narrows to LogitechKeyboardCommand after the brand guard. const action = command as LogitechKeyboardCommand; - const state = (this.initialStatus ?? await this.client.readStatus()).logitech; + if (action.kind === "logitechLiveZones") { + await this.client.updateZoneColors(action.colors, action.wake); + return {}; + } + if (action.kind === "logitechOnboardRead") { + this.onboard = await this.client.readOnboardMemory(); + return { logitechOnboard: this.onboard }; + } + if (action.kind === "logitechOnboardAnimationSave") { + const current = this.onboard ?? await this.client.readOnboardMemory(); + const animations = await this.client.saveOnboardAnimation(action.slot, action.expectedName, action.animation); + this.onboard = { ...current, animations }; + return { logitechOnboard: this.onboard }; + } + if (action.kind === "logitechOnboardSave" || action.kind === "logitechOnboardActivate" || action.kind === "logitechOnboardLeave") { + const current = this.onboard ?? await this.client.readOnboardMemory(); + if (action.kind === "logitechOnboardSave") { + const saved = await this.client.saveOnboardProfile(action.slot, action.revision, action.changes); + this.onboard = { ...current, profiles: current.profiles.map(profile => profile.slot === saved.slot ? saved : profile) }; + const verified = await this.client.readOnboardMemory(); + this.onboard = verified; + if (verified.profiles.find(profile => profile.slot === saved.slot)?.revision !== saved.revision) { + throw new Error("The keyboard did not retain the saved profile."); + } + if (verified.enabled && verified.activeSlot === saved.slot) { + try { + const mode = await this.client.activateOnboardProfile(saved.slot); + this.onboard = { ...verified, ...mode }; + } catch (error) { + throw new Error("The profile was saved to the keyboard. Activate the slot again to apply the changes.", { cause: error }); + } + } + } else { + const mode = action.kind === "logitechOnboardActivate" ? await this.client.activateOnboardProfile(action.slot) : await this.client.leaveOnboardMemory(); + this.onboard = { ...current, ...mode }; + } + return { logitechOnboard: this.onboard }; + } + const vendorStatus = this.initialStatus ?? await this.client.readStatus(); + const state = vendorStatus.logitech; if (!state) throw new Error("The Logitech keyboard did not report its capabilities."); switch (action.kind) { + case "logitechGameModeKeys": { + const gameMode = await this.client.setGameModeDisabledKeys(action.disabled); + this.initialStatus = null; + return { vendorStatus: { ...vendorStatus, logitech: { ...state, gameMode } } }; + } case "logitechPolling": if (state.pollingRateHz === null || !state.supportedPollingRates.includes(action.hz)) throw new Error("Polling rate is not available on this keyboard."); await this.client.setPollingRate(action.hz); @@ -97,12 +161,34 @@ export class LogitechKeyboardClient implements KeyboardClient { if (state.analog?.keyPriority === null || state.analog?.keyPriority === undefined) throw new Error("Key priority is not available on this keyboard."); await this.client.setAnalogKeyPriority(action.enabled); break; - case "logitechRgbEffect": - if (!state.lighting?.rgbZones.length || !state.lighting.rgbZones.every(zone => zone.effects.some(effect => logitechRgbMode(effect.id) === action.mode))) { - throw new Error("The RGB effect is not advertised by every keyboard cluster."); + case "logitechRgbEffect": { + const clusters = state.lighting?.rgbZones.filter(zone => action.cluster === undefined || zone.index === action.cluster); + if (!clusters?.length || !clusters.every(zone => zone.effects.some(effect => logitechRgbMode(effect.id) === action.mode))) { + throw new Error("The RGB effect is not advertised by every selected keyboard cluster."); + } + if (action.target === "idle" && !state.lighting?.timers) throw new Error("The keyboard did not report inactivity settings."); + if (action.cluster === undefined && action.target === undefined && action.color === undefined && action.intensity === undefined && action.periodMs === undefined && action.direction === undefined) { + await this.client.setRgbEffect(action.mode); + } else { + await this.client.setRgbEffect(action.mode, action.color, action.periodMs, { + cluster: action.cluster, target: action.target, + ...(action.intensity === undefined ? {} : { intensity: action.intensity }), + ...(action.direction === undefined ? {} : { direction: action.direction }), + }); } - // HID++ 0x8071 has no active-effect read-back; do not synthesize a selected mode. - await this.client.setRgbEffect(action.mode); + break; + } + case "logitechStartupLighting": + if (!state.lighting?.startup) throw new Error("The keyboard did not report two-color startup lighting."); + await this.client.setStartupLighting(action.settings); + break; + case "logitechZoneColors": + if (!state.lighting?.zones.length) throw new Error("Per-key lighting is not available on this keyboard."); + await this.client.setZoneColors(action.colors); + break; + case "logitechRgbTimers": + if (!state.lighting?.timers) throw new Error("The keyboard did not report inactivity settings."); + await this.client.setRgbTimers(action.timers); break; case "logitechSolidColor": if (!state.lighting?.zones.length) throw new Error("Per-key lighting is not available on this keyboard."); diff --git a/src/device/types.ts b/src/device/types.ts index 2619297a..7ab32d05 100644 --- a/src/device/types.ts +++ b/src/device/types.ts @@ -12,7 +12,7 @@ import type { PreviewMode } from "./preview/preview-modes"; import type { DriverTraits } from "./traits"; import type { M2NexProfile } from "./m2nex-profiles"; -export type WorkspaceTab = "overview" | "performance" | "buttons" | "macro" | "lighting" | "receiver" | "profiles" | "advanced"; +export type WorkspaceTab = "overview" | "performance" | "buttons" | "macro" | "lighting" | "gameMode" | "receiver" | "profiles" | "advanced"; export const WORKSPACE_TAB_ORDER: readonly WorkspaceTab[] = [ "overview", diff --git a/src/features/devices/OverviewPage.tsx b/src/features/devices/OverviewPage.tsx index 8687bab1..44a12482 100644 --- a/src/features/devices/OverviewPage.tsx +++ b/src/features/devices/OverviewPage.tsx @@ -83,6 +83,7 @@ const TAB_ICON: Record = { overview: Gauge, performance: BarChart3, lighting: Lightbulb, + gameMode: Keyboard, buttons: MousePointerClick, macro: Keyboard, profiles: Layers, @@ -607,9 +608,10 @@ export function OverviewPage({ const panel = useRef(null); const { preferences } = snapshot; - const tabs = snapshot.keyboard ? availableKeyboardWorkspaceTabs(snapshot.keyboard.family) : availableWorkspaceTabs(status !== null, cardAvailability(snapshot), { - hideLighting: isNoirKsnakeStatus(status), - }); + const keyboard = snapshot.keyboard; + const tabs = keyboard + ? availableKeyboardWorkspaceTabs(keyboard.family, keyboard.workspace.vendorStatus?.logitech) + : availableWorkspaceTabs(status !== null, cardAvailability(snapshot), { hideLighting: isNoirKsnakeStatus(status) }); const workspaceTab = availableWorkspaceTab(snapshot.workspaceTab, tabs); const workspaceSnapshot = workspaceTab === snapshot.workspaceTab ? snapshot diff --git a/src/features/devices/cards/KeyboardPanel.tsx b/src/features/devices/cards/KeyboardPanel.tsx index d9508ccd..392c624a 100644 --- a/src/features/devices/cards/KeyboardPanel.tsx +++ b/src/features/devices/cards/KeyboardPanel.tsx @@ -1,5 +1,6 @@ import { displayText } from "../../../i18n/index"; import { ArbiterKeyboardPanel } from "./ArbiterKeyboardPanel"; +import { LogitechKeyboardPanel } from "./LogitechKeyboardPanel"; import { KochiKeyboardPanel } from "./KochiKeyboardPanel"; import { WootingKeyboardPanel } from "./WootingKeyboardPanel"; import { KeyboardWorkspaceCards } from "./KeyboardWorkspaceCards"; @@ -10,7 +11,6 @@ import { t, tp } from "../../../i18n/index"; import { RateSlider, StepperSlider } from "../../../shared/ui"; const KeychronKeyboardPanel = lazy(() => import("./KeychronKeyboardPanel").then(({ KeychronKeyboardPanel }) => ({ default: KeychronKeyboardPanel }))); const RazerKeyboardPanel = lazy(() => import("./RazerKeyboardPanel").then(({ RazerKeyboardPanel }) => ({ default: RazerKeyboardPanel }))); -const LogitechKeyboardPanel = lazy(() => import("./LogitechKeyboardPanel").then(({ LogitechKeyboardPanel }) => ({ default: LogitechKeyboardPanel }))); const MchoseKeyboardPanel = lazy(() => import("./MchoseKeyboardPanel").then(({ MchoseKeyboardPanel }) => ({ default: MchoseKeyboardPanel }))); const ViaKeyboardPanel = lazy(() => import("./ViaKeyboardPanel").then(({ ViaKeyboardPanel }) => ({ default: ViaKeyboardPanel }))); const GloriousKeyboardPanel = lazy(() => import("./GloriousKeyboardPanel").then(({ GloriousKeyboardPanel }) => ({ default: GloriousKeyboardPanel }))); @@ -36,7 +36,7 @@ export function KeyboardPanel({ snapshot }: { snapshot: ControlSnapshot }): Reac if (keyboard.family === "keychron") return ; if (keyboard.family === "wooting") return ; if (keyboard.family === "razer") return ; - if (keyboard.family === "logitech") return ; + if (keyboard.family === "logitech") return ; if (keyboard.family === "steelseries") return ; if (keyboard.family === "arbiter") return ; if (keyboard.family === "glorious") return ; diff --git a/src/features/devices/cards/LogitechGameModePanel.tsx b/src/features/devices/cards/LogitechGameModePanel.tsx new file mode 100644 index 00000000..270d9ca6 --- /dev/null +++ b/src/features/devices/cards/LogitechGameModePanel.tsx @@ -0,0 +1,77 @@ +import { useState, type ReactNode } from "react"; +import { G915_X_TKL_FACTORY_BLOCKS, G915_X_TKL_GAME_MODE_KEYS, type LogitechGameModeState } from "@openmouse/keyboard-protocol/logitech"; +import { Lock } from "lucide-react"; +import * as control from "../../../device/controller"; +import { readLogitechGameModeSelection, saveLogitechGameModeSelection } from "../../../device/logitech-game-mode-storage"; +import { t } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { G915_ROWS } from "./logitech-g915-layout"; + +const SPANISH_LAYOUT = 15; +const SPANISH_LEGENDS: Readonly> = { + 0x2d: "'", 0x2e: "¡", 0x2f: "`", 0x30: "+", 0x32: "Ç", 0x33: "Ñ", 0x34: "´", 0x35: "º", 0x38: "−", +}; + +export default function LogitechGameModePanel({ locale, busy, state, deviceId }: { + locale: InterfaceLocale; busy: boolean; state: LogitechGameModeState; deviceId: string | null; +}): ReactNode { + const [selected, setSelected] = useState(() => new Set(readLogitechGameModeSelection(deviceId, state.controls) ?? [])); + const available = new Set(state.controls); + const selection = [...selected].filter(id => available.has(id)); + const spanish = state.layoutCode === SPANISH_LAYOUT; + + async function apply(): Promise { + if (await control.runKeyboardCommand({ kind: "logitechGameModeKeys", disabled: selection })) saveLogitechGameModeSelection(deviceId, selection); + } + + function key(id: number, label: string, space = false): ReactNode { + if (!available.has(id)) return null; + const fixed = G915_X_TKL_FACTORY_BLOCKS.includes(id); + const pressed = fixed || selected.has(id); + const name = space ? t(locale, "key.space") : label; + return ; + } + + return
+
+

{t(locale, "tab.gameMode")}

+ {t(locale, state.active ? "common.on" : "common.off")} +
+

{t(locale, "kb.logitechGameModeHint")}

+
+
+ {key(0x018a, "LIGHTSPEED")}{key(0x0159, "Bluetooth")}{key(0x0184, t(locale, "kb.brightness"))} + {key(0x00e4, t(locale, "prof.prevTrack"))}{key(0x00e5, t(locale, "map.playPause"))} + {key(0x00e6, t(locale, "prof.nextTrack"))}{key(0x00e7, t(locale, "prof.mute"))} +
+ {G915_ROWS.map((row, index) =>
+ {row.map(({ zone, label }) => { + const usage = zone >= 0x68 ? 0xe0 + zone - 0x68 : zone + 3; + if (spanish && usage === 0x31) return null; + if (usage === 0xe7) return key(0x004f, t(locale, "kb.logitechGameModeMenu")); + const id = G915_X_TKL_GAME_MODE_KEYS.get(usage); + return id === undefined ? null : key(id, (spanish ? SPANISH_LEGENDS[usage] : undefined) ?? label, usage === 0x2c); + })} +
)} +
+

{t(locale, "kb.logitechGameModeReplace")}

+
+ + + +
+
; +} diff --git a/src/features/devices/cards/LogitechKeyTrail.tsx b/src/features/devices/cards/LogitechKeyTrail.tsx new file mode 100644 index 00000000..bf71a268 --- /dev/null +++ b/src/features/devices/cards/LogitechKeyTrail.tsx @@ -0,0 +1,143 @@ +import { useEffect, useRef, useState, type ReactNode } from "react"; +import type { LogitechRgbColor } from "@openmouse/keyboard-protocol/logitech"; +import { keyboardSession, paintLogitechZones, runKeyboardCommand } from "../../../device/controller"; +import { t } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { g915TrailZoneForCode } from "./logitech-g915-layout"; + +function readColor(value: FormDataEntryValue | null): LogitechRgbColor { + const rgb = Number.parseInt(String(value).slice(1), 16); + return { red: rgb >> 16, green: (rgb >> 8) & 255, blue: rgb & 255 }; +} + +interface Trail { + session: unknown; + zones: ReadonlySet; + duration: number; + base: LogitechRgbColor; + color: LogitechRgbColor; + deadlines: Map>; + pending: Map; + writing: boolean; + onError: () => void; +} + +async function writeTrail(trail: Trail): Promise { + if (trail.writing) return; + trail.writing = true; + try { + while (trail.pending.size) { + const frame = Array.from(trail.pending, ([zone, color]) => ({ zone, ...color })); + trail.pending.clear(); + await paintLogitechZones(trail.session, frame); + } + } catch { + queueMicrotask(trail.onError); + } finally { + trail.writing = false; + } +} + +function stopTrail(trail: Trail): void { + for (const [zone, timer] of trail.deadlines) { + clearTimeout(timer); + trail.pending.set(zone, trail.base); + } + trail.deadlines.clear(); + void writeTrail(trail); +} + +export function LogitechKeyTrail({ locale, busy, zones, initialBase }: { + locale: InterfaceLocale; busy: boolean; zones: readonly number[]; initialBase: string; +}): ReactNode { + const capture = useRef(null); + const active = useRef(null); + const generation = useRef(0); + const [running, setRunning] = useState(false); + const [starting, setStarting] = useState(false); + const [failed, setFailed] = useState(false); + + useEffect(() => () => { + generation.current++; + const trail = active.current; + active.current = null; + if (trail) stopTrail(trail); + }, []); + + function stop(): void { + const trail = active.current; + active.current = null; + if (trail) stopTrail(trail); + setRunning(false); + } + + async function start(form: HTMLFormElement): Promise { + const values = new FormData(form); + const duration = Number(values.get("duration")); + if (!Number.isInteger(duration) || duration < 50 || duration > 2000) return; + const base = readColor(values.get("base")); + const color = readColor(values.get("color")); + const session = keyboardSession(); + const token = ++generation.current; + setStarting(true); + setFailed(false); + const prepared = await runKeyboardCommand({ + kind: "logitechZoneColors", colors: zones.map(zone => ({ zone, ...base })), + }, session); + if (generation.current !== token) return; + setStarting(false); + if (!prepared) return; + const trail: Trail = { + session, zones: new Set(zones), duration, base, color, + deadlines: new Map(), pending: new Map(), writing: false, + onError: () => { + if (active.current !== trail) return; + setFailed(true); + stop(); + }, + }; + active.current = trail; + setRunning(true); + capture.current?.focus(); + } + + return
{ + event.preventDefault(); + if (!running && !starting) void start(event.currentTarget); + }}> +

{t(locale, "kb.logitechTrailHint")}

+ + + + + + {failed ?

{t(locale, "kb.readFailed")}

: null} +
; +} diff --git a/src/features/devices/cards/LogitechKeyboardPanel.tsx b/src/features/devices/cards/LogitechKeyboardPanel.tsx index 831b6bfe..c4b94913 100644 --- a/src/features/devices/cards/LogitechKeyboardPanel.tsx +++ b/src/features/devices/cards/LogitechKeyboardPanel.tsx @@ -1,11 +1,16 @@ -import type { FormEvent, ReactNode } from "react"; +import { lazy, Suspense, type FormEvent, type ReactNode } from "react"; import { logitechRgbMode, type LogitechRgbMode } from "@openmouse/keyboard-protocol/logitech"; import type { ControlSnapshot } from "../../../device/types"; import * as control from "../../../device/controller"; import { displayText, t } from "../../../i18n/index"; +import { Palette, Power, Timer } from "lucide-react"; import { Segmented, StepperSlider, SwitchRow } from "../../../shared/ui"; +import { logitechPerformanceControls } from "../workspace-tabs"; +import { LogitechClusterEffects, LogitechInactivity, LogitechStartupEditor, LogitechZoneEditor } from "./LogitechLightingEditor"; const MODES: readonly LogitechRgbMode[] = ["Off", "Static", "Cycling", "Wave", "Breathing single"]; +const LogitechGameModePanel = lazy(() => import("./LogitechGameModePanel")); +const LogitechOnboardPanel = lazy(() => import("./LogitechOnboardPanel")); export function LogitechKeyboardPanel({ snapshot }: { snapshot: ControlSnapshot }): ReactNode { const keyboard = snapshot.keyboard; @@ -16,11 +21,23 @@ export function LogitechKeyboardPanel({ snapshot }: { snapshot: ControlSnapshot const tab = snapshot.workspaceTab; const identity = keyboard.identity; const brightness = status?.brightness; - const analog = status?.analog; + const { polling, rapidTrigger, keyPriority } = logitechPerformanceControls(status); + // Protocol versions before performance reporting still expose the individual values. + const performanceStatus = status && "performanceStatus" in status ? status.performanceStatus : null; + const performanceReadFailed = performanceStatus === "unavailable" || performanceStatus === "partial"; const lighting = status?.lighting; + const gameMode = status?.gameMode; + const gameModeDevice = status?.unitId ?? status?.serial ?? null; + const g915XTkl = /\bg915\s*x\b.*\btkl\b/i.test(keyboard.name); + const hasBrightness = !!brightness && brightness.max > brightness.min; + const hasZones = !!lighting?.zones?.length; + const clusters = lighting?.rgbZones ?? []; + const hasActiveLighting = hasBrightness || hasZones || clusters.length > 0; + const needsLightingRead = (!hasActiveLighting && !lighting?.timers && !lighting?.startup) + || (g915XTkl && (!clusters.length || !lighting?.timers || !lighting?.startup)); // 0x8071 applies a mode only where supported. Offer only modes shared by all clusters. - const modes = lighting?.rgbZones.length - ? MODES.filter(mode => lighting.rgbZones.every(zone => zone.effects.some(effect => logitechRgbMode(effect.id) === mode))) + const modes = clusters.length + ? MODES.filter(mode => clusters.every(zone => zone.effects.some(effect => logitechRgbMode(effect.id) === mode))) : []; const sendColor = (event: FormEvent): void => { event.preventDefault(); @@ -33,8 +50,20 @@ export function LogitechKeyboardPanel({ snapshot }: { snapshot: ControlSnapshot } }; - return
- {keyboard.trigger.statusText ? {displayText(locale, keyboard.trigger.statusText)} : null} + const refresh = ; + const performanceNotice = performanceReadFailed + ?

{t(locale, "kb.logitechPerformanceReadFailed")}

+ : null; + return
+ {tab === "lighting" || keyboard.trigger.statusText ? {keyboard.trigger.statusText && displayText(locale, keyboard.trigger.statusText)} : null} + {tab === "gameMode" && gameMode ? + + : null} + {tab === "profiles" && status?.onboardMemory ? + + : null} {tab === "overview" ?

{keyboard.name}

@@ -43,36 +72,47 @@ export function LogitechKeyboardPanel({ snapshot }: { snapshot: ControlSnapshot {status?.battery?.percent != null ?
{t(locale, "kb.logitechBattery")}
{status.battery.percent}%
: status?.battery?.level ?
{t(locale, "kb.logitechBattery")}
{t(locale, `kb.logitechBattery${status.battery.level}`)}
: null}
- + {performanceNotice} + {refresh}
: null} - {tab === "performance" && (status?.pollingRateHz != null && status.supportedPollingRates.length > 0 || analog?.rapidTrigger != null || analog?.keyPriority != null) ?
+ {tab === "performance" ?

{t(locale, "kb.performance")}

- {status?.pollingRateHz != null && status.supportedPollingRates.length > 0 ?
+ {polling ?
{t(locale, "kb.pollingRate")} - ({ value: hz, label: `${hz} Hz` }))} + ({ value: hz, label: `${hz} Hz` }))} onChange={hz => void control.applyKeyboardCommand({ kind: "logitechPolling", hz })} />
: null} - {analog?.rapidTrigger != null ? void control.applyKeyboardCommand({ kind: "logitechRapidTrigger", enabled })} /> : null} - {analog?.keyPriority != null ? void control.applyKeyboardCommand({ kind: "logitechKeyPriority", enabled })} /> : null} + {performanceNotice} + {performanceReadFailed ? refresh : null}
: null} - {tab === "lighting" && (brightness || modes.length || lighting?.zones.length) ?
-

{t(locale, "kb.lighting")}

- {brightness && brightness.max > brightness.min ? +

{t(locale, "kb.lighting")}

+ {busy ? null :

{t(locale, "kb.logitechLightingUnavailable")}

} + {refresh} +
: null} + {tab === "lighting" && hasActiveLighting ?
+

{t(locale, "kb.logitechEffectActive")}

+ {hasBrightness ? String(value)} disabled={busy} onCommit={value => control.applyKeyboardCommand({ kind: "logitechBrightness", value })} /> : null} - {modes.length ?
{t(locale, "kb.logitechRgbEffect")} + {lighting && (clusters.length || (g915XTkl && hasZones)) ? : null} + {modes.length || hasZones ?
+ {t(locale, "kb.logitechMoreControls")} + {modes.length ?
{t(locale, "kb.logitechClusterEffects")}
{modes.map(mode => )}

{t(locale, "kb.logitechRgbNoReadback")}

: null} - {lighting?.zones.length ?
+ {hasZones ?
{t(locale, "kb.logitechSolidColor")} {(["red", "green", "blue"] as const).map(channel =>

{t(locale, "kb.logitechColorNoReadback")}

: null} +
: null} +
: null} + {tab === "lighting" && (lighting?.timers || g915XTkl) ?
+

{t(locale, "kb.logitechInactivity")}

+ {lighting?.timers ? <> + {clusters.length ? : null} + + :

{t(locale, "kb.notReported")}

}
: null} + {tab === "lighting" && lighting && hasZones ? : null} + {tab === "lighting" && lighting?.startup + ? + : tab === "lighting" && g915XTkl ?
+

{t(locale, "kb.logitechStartup")}

+

{t(locale, "kb.notReported")}

+
: null}
; } diff --git a/src/features/devices/cards/LogitechLightingEditor.tsx b/src/features/devices/cards/LogitechLightingEditor.tsx new file mode 100644 index 00000000..20911cc2 --- /dev/null +++ b/src/features/devices/cards/LogitechLightingEditor.tsx @@ -0,0 +1,306 @@ +import { lazy, Suspense, useState, type FormEvent, type ReactNode } from "react"; +import { logitechRgbMode, logitechSupportsWaveDirection, type LogitechLightingState, type LogitechRgbColor, type LogitechRgbMode, type LogitechStartupLighting, type LogitechRgbTarget, type LogitechRgbTimers, type LogitechRgbWaveDirection } from "@openmouse/keyboard-protocol/logitech"; +import { Keyboard, Power } from "lucide-react"; +import * as control from "../../../device/controller"; +import { t, tp, type I18nKey } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { G915_ROWS } from "./logitech-g915-layout"; +import type { LogitechPerKeyEffect } from "./LogitechPerKeyEffects"; + +const LogitechPerKeyEffects = lazy(() => import("./LogitechPerKeyEffects")); +const PER_KEY_EFFECTS = { trail: "kb.logitechTrailMode", aurora: "kb.logitechAurora", circle: "kb.logitechCircularRainbow" } as const; + +const MODES: Readonly> = { + Off: "common.off", Static: "kb.logitechSolidColor", Cycling: "kb.logitechColorCycle", + Wave: "kb.logitechRainbowWave", "Breathing single": "adv.ledBreathing", Ripple: "kb.logitechKeyRipple", +}; +const WAVE_DIRECTIONS = [[1, "kb.logitechWaveRight"], [3, "kb.logitechWaveCenterOut"], [8, "kb.logitechWaveCenterIn"], [2, "kb.logitechWaveDown"]] as const; + +type Props = { locale: InterfaceLocale; busy: boolean; lighting: LogitechLightingState }; +const colorFromHex = (hex: string) => ({ + red: Number.parseInt(hex.slice(1, 3), 16), + green: Number.parseInt(hex.slice(3, 5), 16), + blue: Number.parseInt(hex.slice(5, 7), 16), +}); + +const PRESETS = [ + [0, 255, 255], [39, 114, 255], [160, 91, 255], [255, 48, 132], + [255, 72, 48], [255, 183, 41], [30, 218, 112], [255, 255, 255], [0, 0, 0], +] as const; + +function colorHex({ red, green, blue }: LogitechRgbColor): string { + return `#${[red, green, blue].map(value => value.toString(16).padStart(2, "0")).join("")}`; +} + +function LogitechPalette({ locale, disabled, onApply }: { + locale: InterfaceLocale; disabled: boolean; onApply: (color: LogitechRgbColor) => void; +}): ReactNode { + return
+ {t(locale, "kb.logitechPresets")} + {PRESETS.map(([red, green, blue]) => { + const color = { red, green, blue }; + const hex = colorHex(color); + return ; + })} +
; +} + +const hardwareKeys: readonly { zone: number; label: I18nKey }[] = [ + { zone: 0xd2, label: "kb.logitechLogo" }, + { zone: 0x99, label: "kb.brightness" }, + { zone: 0x9e, label: "prof.prevTrack" }, + { zone: 0x9b, label: "map.playPause" }, + { zone: 0x9d, label: "prof.nextTrack" }, + { zone: 0x9c, label: "prof.mute" }, +]; +const spaceZone = 0x2c - 3; +// USB HID usages 0x53–0x63 are the numeric keypad. The TKL firmware +// advertises their LED IDs even though the chassis has no number pad. +const numpadLedKeys = ["Num", "/", "*", "−", "+", "↵", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "."]; + +export function LogitechZoneEditor({ locale, busy, lighting, mapped }: Props & { mapped: boolean }): ReactNode { + const [selected, setSelected] = useState>(new Set()); + const present = new Set(lighting.zones.filter(zone => zone > 0 && zone < 255)); + const auxiliary = mapped ? hardwareKeys.filter(entry => present.has(entry.zone)) : []; + const rows = mapped ? G915_ROWS : []; + const visible = new Set([...rows.flat(), ...auxiliary].map(entry => entry.zone)); + const extra = [...present].filter(zone => !visible.has(zone)); + const active = [...selected].filter(zone => present.has(zone)); + + function toggle(zone: number): void { + setSelected(current => { + const next = new Set(current); + if (next.has(zone)) next.delete(zone); + else next.add(zone); + return next; + }); + } + + function button(zone: number, label: string, isSpace = false): ReactNode { + const chosen = selected.has(zone); + return ; + } + + function applyColor(color: LogitechRgbColor): void { + if (active.length) void control.applyKeyboardCommand({ kind: "logitechZoneColors", colors: active.map(zone => ({ ...color, zone })) }); + } + + return
+

{t(locale, "kb.logitechZoneEditor")}

+

{t(locale, "kb.selectionHint")}

+ {rows.length ?
+ {auxiliary.length ?
+ {auxiliary.map(entry => button(entry.zone, t(locale, entry.label)))} +
: null} + {rows.map((row, index) =>
+ {row.filter(entry => present.has(entry.zone)).map(entry => button(entry.zone, entry.label, entry.zone === spaceZone))} +
)} +
: null} + {extra.length ?
+ {t(locale, "kb.logitechOtherZones")} + {mapped ?

{t(locale, "kb.logitechFirmwareLedsHint")}

: null} +
+ {extra.map(zone => { + const keypadKey = mapped ? numpadLedKeys[zone - 80] : undefined; + return button(zone, keypadKey + ? tp(locale, "kb.logitechNumpad", { key: keypadKey }) + : tp(locale, "kb.logitechLedId", { id: `0x${zone.toString(16).toUpperCase().padStart(2, "0")}` })); + })} +
+
: null} +
{ + event.preventDefault(); + applyColor(colorFromHex(String(new FormData(event.currentTarget).get("color")))); + }}> + + + {tp(locale, "kb.selectedCount", { n: active.length })} + + +
+ +

{t(locale, "kb.logitechColorNoReadback")}

+
; +} + +export function LogitechClusterEffects({ locale, busy, lighting, target, idleBrightness, perKey }: Props & { + target: LogitechRgbTarget; idleBrightness?: boolean; perKey?: boolean; +}): ReactNode { + const [cluster, setCluster] = useState(""); + const [mode, setMode] = useState("Static"); + const [perKeyEffect, setPerKeyEffect] = useState(null); + const [color, setColor] = useState(colorHex({ red: 0, green: 255, blue: 255 })); + const [intensity, setIntensity] = useState(String(lighting.idleBrightness ?? "")); + const [periods, setPeriods] = useState>>({}); + const [direction, setDirection] = useState(1); + const allClusters = lighting.rgbZones; + const clusters = cluster === "" ? allClusters : allClusters.filter(zone => zone.index === Number(cluster)); + const supports = (zone: (typeof allClusters)[number], effect: LogitechRgbMode): boolean => + zone.effects.some(info => logitechRgbMode(info.id) === effect); + const modes = (Object.keys(MODES) as LogitechRgbMode[]).filter(effect => { + if (effect === "Ripple" && target === "idle") return false; + const count = clusters.filter(zone => supports(zone, effect)).length; + return count > 0 && (count === 1 || count === clusters.length); + }); + const selectedMode = modes.includes(mode) ? mode : modes[0]; + const hasPerKeyEffects = target === "active" && perKey && G915_ROWS.some(row => row.some(key => lighting.zones.includes(key.zone))); + const customEffect = hasPerKeyEffects ? perKeyEffect ?? (selectedMode === undefined ? "aurora" : null) : null; + const waveClusters = clusters.filter(zone => supports(zone, "Wave")); + const directions = selectedMode === "Wave" ? WAVE_DIRECTIONS.filter(([value]) => + waveClusters.every(zone => zone.effects.some(effect => logitechSupportsWaveDirection(effect, value)))) : []; + const selectedDirection = directions.some(([value]) => value === direction) ? direction : directions[0]?.[0]; + const usesColor = selectedMode === "Static" || selectedMode === "Breathing single" || selectedMode === "Ripple"; + const usesPeriod = selectedMode !== undefined && selectedMode !== "Off" && selectedMode !== "Static"; + const minPeriod = selectedMode === "Ripple" ? 2 : 1; + const maxPeriod = selectedMode === "Ripple" ? 200 : 65535; + const period = selectedMode ? periods[selectedMode] ?? "" : ""; + const validPeriod = !usesPeriod || period === "" || (Number.isInteger(Number(period)) && Number(period) >= minPeriod && Number(period) <= maxPeriod); + const validIntensity = !idleBrightness || intensity === "" || (Number.isInteger(Number(intensity)) && Number(intensity) >= 0 && Number(intensity) <= 100); + + function chooseMode(effect: LogitechRgbMode): void { + setMode(effect); + if (cluster !== "") return; + const matching = allClusters.filter(zone => supports(zone, effect)); + if (matching.length === 1 && allClusters.length > 1) setCluster(String(matching[0]!.index)); + } + + function apply(effect: LogitechRgbMode, rgb?: LogitechRgbColor, periodMs?: number): void { + if (!validIntensity) return; + const matching = clusters.filter(zone => supports(zone, effect)); + // At most one explicit target is needed when a mode is unavailable on the logo. + const destination = cluster !== "" ? Number(cluster) + : matching.length === 1 && clusters.length > 1 ? matching[0]!.index : undefined; + void control.applyKeyboardCommand({ + kind: "logitechRgbEffect", mode: effect, cluster: destination, + target, color: rgb, periodMs, direction: effect === "Wave" ? selectedDirection : undefined, + intensity: idleBrightness && intensity !== "" ? Number(intensity) : undefined, + }); + } + + return <> +
{ + event.preventDefault(); + if (!customEffect && selectedMode && validPeriod) { + apply(selectedMode, usesColor ? colorFromHex(color) : undefined, usesPeriod && period !== "" ? Number(period) : undefined); + } + }}> + {!customEffect ? : null} + + {!customEffect ? <> + + {usesPeriod ? : null} + {directions.length > 1 ? : null} + {idleBrightness ? : null} + + : null} +
+ {customEffect ? + + : { + setMode("Static"); + setColor(colorHex(rgb)); + apply("Static", rgb); + }} />} + ; +} + +export function LogitechInactivity({ locale, busy, timers }: { locale: InterfaceLocale; busy: boolean; timers: LogitechRgbTimers }): ReactNode { + function apply(event: FormEvent): void { + event.preventDefault(); + const data = new FormData(event.currentTarget); + const dim = String(data.get("dim") ?? ""); + const off = String(data.get("off") ?? ""); + void control.applyKeyboardCommand({ + kind: "logitechRgbTimers", + timers: { dimAfterSeconds: dim === "" ? null : Number(dim), offAfterDimSeconds: off === "" ? null : Number(off) }, + }); + } + + return
+ + + +

{t(locale, "kb.logitechTimerHint")}

+
; +} + +export function LogitechStartupEditor({ locale, busy, startup }: { locale: InterfaceLocale; busy: boolean; startup: LogitechStartupLighting }): ReactNode { + const primary = colorHex(startup.primary); + const secondary = colorHex(startup.secondary); + + function apply(event: FormEvent): void { + event.preventDefault(); + const data = new FormData(event.currentTarget); + void control.applyKeyboardCommand({ + kind: "logitechStartupLighting", + settings: { + enabled: data.has("enabled"), + primary: colorFromHex(String(data.get("primary"))), + secondary: colorFromHex(String(data.get("secondary"))), + }, + }); + } + + return
+

{t(locale, "kb.logitechStartup")}

+
+ + + + +
+
; +} diff --git a/src/features/devices/cards/LogitechOnboardAnimations.tsx b/src/features/devices/cards/LogitechOnboardAnimations.tsx new file mode 100644 index 00000000..ad46dcc9 --- /dev/null +++ b/src/features/devices/cards/LogitechOnboardAnimations.tsx @@ -0,0 +1,93 @@ +import { useState, type FormEvent, type ReactNode } from "react"; +import type { LogitechAnimationSlot, LogitechRgbColor } from "@openmouse/keyboard-protocol/logitech"; +import { applyKeyboardCommand } from "../../../device/controller"; +import { t, tp } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { G915_ROWS } from "./logitech-g915-layout"; +import { auroraColors, circularFrames, LOGITECH_RAINBOW_STEPS, logitechFormColor, logitechLedPositions } from "./logitech-lighting-frames"; + +const primaryColor = `#${0x00eedc.toString(16).padStart(6, "0")}`; +const secondaryColor = `#${0xb432ff.toString(16)}`; + +type Kind = "fixed" | "aurora" | "circle"; + +export function LogitechOnboardAnimations({ locale, busy, slots, available }: { + locale: InterfaceLocale; busy: boolean; slots: readonly LogitechAnimationSlot[]; available: readonly number[]; +}): ReactNode { + const [slot, setSlot] = useState<0 | 1>(slots.find(item => item.name === null)?.slot ?? 0); + const [kind, setKind] = useState("aurora"); + const [paint, setPaint] = useState(primaryColor); + const [byKey, setByKey] = useState>(new Map()); + const positions = logitechLedPositions(G915_ROWS, available.filter(zone => zone > 0)); + const present = new Set(positions.map(({ zone }) => zone)); + const current = slots.find(item => item.slot === slot); + + function submit(event: FormEvent): void { + event.preventDefault(); + const fields = new FormData(event.currentTarget); + if (!current || (current.name && !fields.has("replace"))) return; + const color = (name: string): LogitechRgbColor => logitechFormColor(fields.get(name)); + const base = color("primary"); + const phase = circularFrames(positions); + const frames = kind === "circle" ? Array.from({ length: LOGITECH_RAINBOW_STEPS }, (_, step) => ({ colors: phase(step) })) + : [{ colors: kind === "aurora" ? auroraColors(positions, base, color("secondary")) + : positions.map(({ zone }) => ({ zone, ...(byKey.has(zone) ? logitechFormColor(byKey.get(zone)!) : base) })) }]; + void applyKeyboardCommand({ kind: "logitechOnboardAnimationSave", slot, expectedName: current.name, + animation: { name: String(fields.get("name")), frames, frameMs: kind === "circle" ? Math.round(Number(fields.get("period")) / LOGITECH_RAINBOW_STEPS) : 1000 } }); + } + + return
+ {t(locale, "kb.logitechOnboardAnimations")} +
+

{t(locale, "kb.logitechOnboardAnimationHint")}

+
+ + + + {kind === "circle" ? : } + {kind === "aurora" ? : null} + {kind === "fixed" ? : null} +
+ {kind === "fixed" ?
+ {G915_ROWS.map((row, i) =>
+ {row.filter(({ zone }) => present.has(zone)).map(({ zone, label }) => )} +
)} +
: null} + {current?.name ? : null} +
+
+
; +} diff --git a/src/features/devices/cards/LogitechOnboardAssignments.tsx b/src/features/devices/cards/LogitechOnboardAssignments.tsx new file mode 100644 index 00000000..86ab3954 --- /dev/null +++ b/src/features/devices/cards/LogitechOnboardAssignments.tsx @@ -0,0 +1,63 @@ +import { useState, type FormEvent, type ReactNode } from "react"; +import { G915_X_TKL_GAME_MODE_KEYS, type LogitechGameModeState, type LogitechOnboardProfile } from "@openmouse/keyboard-protocol/logitech"; +import { applyKeyboardCommand } from "../../../device/controller"; +import { t } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { G915_ROWS } from "./logitech-g915-layout"; + +const modifiers = [[1, "Ctrl"], [2, "Shift"], [4, "Alt"], [8, "Meta"]] as const; + +function ShortcutTarget({ locale, initial, options }: { + locale: InterfaceLocale; initial: number; options: readonly { usage: number; label: string }[]; +}): ReactNode { + const [target, setTarget] = useState(initial); + return ; +} + +export function LogitechOnboardAssignments({ locale, busy, profile, gameMode }: { + locale: InterfaceLocale; busy: boolean; profile: LogitechOnboardProfile; gameMode: LogitechGameModeState; +}): ReactNode { + const [source, setSource] = useState(0x3e); + const options = G915_ROWS.flat().filter(({ zone }) => zone < 0x68).flatMap(({ zone, label }) => { + const usage = zone + 3; + if (gameMode.layoutCode === 15 && usage === 0x31) return []; + const id = G915_X_TKL_GAME_MODE_KEYS.get(usage); + const index = id === undefined ? -1 : gameMode.controls.indexOf(id); + return index < 0 ? [] : [{ usage, index, label: usage === 0x2c ? t(locale, "key.space") : label }]; + }); + const current = profile.bindings?.find(binding => binding.index === options.find(option => option.usage === source)?.index); + + function submit(event: FormEvent): void { + event.preventDefault(); + const data = new FormData(event.currentTarget); + const target = Number(data.get("target")); + const bits = modifiers.reduce((mask, [bit]) => data.has(String(bit)) ? mask | bit : mask, 0); + void applyKeyboardCommand({ kind: "logitechOnboardSave", slot: profile.slot, revision: profile.revision, + changes: { binding: { sourceUsage: source, targetUsage: target || null, modifiers: bits } } }); + } + + return
+ {t(locale, "prof.assign")} + {profile.bindings === null ?

{t(locale, "kb.notReported")}

:
+

{t(locale, "kb.logitechOnboardAssignmentHint")}

+
+ + +
+ {modifiers.map(([bit, label]) => )} +
+
+
+
} +
; +} diff --git a/src/features/devices/cards/LogitechOnboardPanel.tsx b/src/features/devices/cards/LogitechOnboardPanel.tsx new file mode 100644 index 00000000..3576f1f1 --- /dev/null +++ b/src/features/devices/cards/LogitechOnboardPanel.tsx @@ -0,0 +1,165 @@ +import { useEffect, useRef, useState, type FormEvent, type ReactNode } from "react"; +import { logitechRgbMode, type LogitechAnimationSlot, type LogitechKeyboardState, type LogitechOnboardEffect, type LogitechOnboardLightingTarget, type LogitechOnboardLightingMode, type LogitechOnboardMemory, type LogitechOnboardProfile, type LogitechOnboardProfileChanges } from "@openmouse/keyboard-protocol/logitech"; +import { Layers } from "lucide-react"; +import * as control from "../../../device/controller"; +import { readLogitechGameModeSelection } from "../../../device/logitech-game-mode-storage"; +import { t, tp, type I18nKey } from "../../../i18n/index"; +import { Segmented } from "../../../shared/ui"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { LogitechOnboardAssignments } from "./LogitechOnboardAssignments"; +import { LogitechOnboardAnimations } from "./LogitechOnboardAnimations"; +import { logitechFormColor } from "./logitech-lighting-frames"; + +const EFFECTS: Readonly> = { + Off: "common.off", Static: "kb.logitechSolidColor", Cycling: "kb.logitechColorCycle", + Wave: "kb.logitechRainbowWave", "Breathing single": "adv.ledBreathing", Ripple: "kb.logitechKeyRipple", +}; + +const TARGETS = ["keys", "logo", "idleKeys", "idleLogo"] as const; +const LABELS: Record = { + keys: "kb.logitechOnboardLighting", logo: "kb.logitechLogo", idleKeys: "kb.logitechOnboardIdleKeys", idleLogo: "kb.logitechOnboardIdleLogo", +}; +const hasColor = (mode: string) => mode === "Static" || mode === "Breathing single" || mode === "Ripple"; +const hasPeriod = (mode: string) => mode === "Breathing single" || mode === "Cycling" || mode === "Wave" || mode === "Ripple"; + +function StoredEffectField({ locale, target, effect, modes, animations = [] }: { + locale: InterfaceLocale; target: LogitechOnboardLightingTarget; effect: LogitechOnboardEffect; + modes: readonly LogitechOnboardLightingMode[]; animations?: readonly LogitechAnimationSlot[]; +}): ReactNode { + const [mode, setMode] = useState("keep"); + const currentMode = logitechRgbMode(effect.effectId); + const color = effect.color ? [effect.color.red, effect.color.green, effect.color.blue] : [255, 255, 255]; + const hex = `#${color.map(value => value.toString(16).padStart(2, "0")).join("")}`; + const savedMode = currentMode ? t(locale, EFFECTS[currentMode]) : animations.find(item => item.slot === effect.animationSlot)?.name; + const current = effect.color ? `${savedMode}, ${hex}` : savedMode; + return <> + + {hasColor(mode) ? : null} + {hasPeriod(mode) ? : null} + ; +} + +function OnboardProfileEditor({ locale, busy, profile, state, animations, gameModeKeys }: { + locale: InterfaceLocale; busy: boolean; profile: LogitechOnboardProfile; state: LogitechKeyboardState; + animations?: readonly LogitechAnimationSlot[]; gameModeKeys: readonly number[] | null; +}): ReactNode { + const modes = (target: LogitechOnboardLightingTarget) => { + const location = target === "logo" || target === "idleLogo" ? 2 : 1; + const items = state.lighting?.rgbZones.find(item => item.location === location)?.effects ?? []; + return [...new Set(items.flatMap(item => { + const mode = logitechRgbMode(item.id); + return mode && (mode !== "Ripple" || target === "keys") ? [mode] : []; + }))]; + }; + const effectField = (target: LogitechOnboardLightingTarget) => ; + const [invalidTimers, setInvalidTimers] = useState(false); + + function submit(event: FormEvent): void { + event.preventDefault(); + const values = new FormData(event.currentTarget); + const dim = values.get("dim"), off = values.get("off"); + const dimAfterSeconds = dim ? Number(dim) : null; + const offAfterSeconds = off ? Number(off) : null; + if (dimAfterSeconds !== null && offAfterSeconds !== null && offAfterSeconds < dimAfterSeconds) { + setInvalidTimers(true); + return; + } + const changes: LogitechOnboardProfileChanges = {}; + const name = String(values.get("name") ?? "").trim(); + if (name !== profile.name) changes.name = name; + if (dimAfterSeconds !== profile.dimAfterSeconds) changes.dimAfterSeconds = dimAfterSeconds; + if (offAfterSeconds !== profile.offAfterSeconds) changes.offAfterSeconds = offAfterSeconds; + for (const target of TARGETS) { + const mode = values.get(target); + if (mode === "animation:0" || mode === "animation:1") changes.animationSlot = mode === "animation:0" ? 0 : 1; + if (typeof mode !== "string" || !Object.hasOwn(EFFECTS, mode)) continue; + changes.lightingByTarget ??= {}; + changes.lightingByTarget[target] = { + mode: mode as LogitechOnboardLightingMode, + ...(hasColor(mode) ? { color: logitechFormColor(values.get(`${target}:color`)) } : {}), + ...(hasPeriod(mode) ? { periodMs: Number(values.get(`${target}:period`)) } : {}), + }; + } + if (values.has("gameMode") && gameModeKeys !== null) changes.gameModeDisabledKeys = gameModeKeys; + void control.applyKeyboardCommand({ kind: "logitechOnboardSave", slot: profile.slot, revision: profile.revision, changes }); + } + + return
invalidTimers && setInvalidTimers(false)}> +
+ + {effectField("keys")} + + +
+
+ {t(locale, "kb.logitechOnboardExtraLighting")} +
{TARGETS.slice(1).map(effectField)}
+
+ {gameModeKeys !== null ? : null} + {invalidTimers ?

{t(locale, "kb.logitechOnboardTimers")}

: null} +
+ + +
+
; +} + +export default function LogitechOnboardPanel({ locale, busy, memory, deviceId, state }: { + locale: InterfaceLocale; busy: boolean; memory?: LogitechOnboardMemory; deviceId: string | null; state: LogitechKeyboardState; +}): ReactNode { + const attempted = useRef(false); + const [slot, setSlot] = useState(null); + useEffect(() => { + if (busy || attempted.current) return; + attempted.current = true; + void control.applyKeyboardCommand({ kind: "logitechOnboardRead" }); + }, [busy]); + + const profile = memory?.profiles.find(item => item.slot === (slot ?? memory.activeSlot)); + const gameModeKeys = state.gameMode ? readLogitechGameModeSelection(deviceId, state.gameMode.controls) : null; + + return
+

{t(locale, "kb.logitechOnboardTitle")}

+ {memory ? <> +

{t(locale, "kb.logitechOnboardHint")}

+
+ ({ value: item.slot, label: item.name || tp(locale, "prof.profileName", { n: item.slot }) }))} onChange={setSlot} /> +

{memory.enabled ? tp(locale, "kb.logitechOnboardActiveSlot", { n: memory.activeSlot }) : t(locale, "kb.logitechOnboardOff")}

+
+ : null} + {profile ? : null} + {profile && state.gameMode ? : null} + {memory?.animations?.length && state.lighting?.zones.length ? : null} +
+ + {memory?.enabled ? : null} +
+
; +} diff --git a/src/features/devices/cards/LogitechPerKeyEffects.tsx b/src/features/devices/cards/LogitechPerKeyEffects.tsx new file mode 100644 index 00000000..1ab2db47 --- /dev/null +++ b/src/features/devices/cards/LogitechPerKeyEffects.tsx @@ -0,0 +1,105 @@ +import { useEffect, useRef, useState, type ReactNode } from "react"; +import { applyKeyboardCommand, keyboardSession, paintLogitechZones, runKeyboardCommand } from "../../../device/controller"; +import { t } from "../../../i18n/index"; +import type { InterfaceLocale } from "../../settings/interface-preferences"; +import { LogitechKeyTrail } from "./LogitechKeyTrail"; +import { auroraColors, circularFrames, LOGITECH_RAINBOW_STEPS, logitechFormColor, logitechLedPositions } from "./logitech-lighting-frames"; + +export type LogitechPerKeyEffect = "trail" | "aurora" | "circle"; + +interface EffectProps { locale: InterfaceLocale; busy: boolean; positions: ReturnType } +interface Animation { timer?: ReturnType } + +function Aurora({ locale, busy, positions }: EffectProps): ReactNode { + return
{ + event.preventDefault(); + const values = new FormData(event.currentTarget); + const colors = auroraColors(positions, logitechFormColor(values.get("primary")), logitechFormColor(values.get("secondary"))); + void applyKeyboardCommand({ kind: "logitechZoneColors", colors }); + }}> + + + +
; +} + +function CircularRainbow({ locale, busy, positions }: EffectProps): ReactNode { + const animation = useRef(null); + const [running, setRunning] = useState(false); + const [failed, setFailed] = useState(false); + + useEffect(() => () => { + clearTimeout(animation.current?.timer); + animation.current = null; + }, []); + + function stop(): void { + clearTimeout(animation.current?.timer); + animation.current = null; + setRunning(false); + } + + async function start(period: number): Promise { + if (animation.current || !Number.isInteger(period) || period < 1000 || period > 10000) return; + const run: Animation = {}; + animation.current = run; + setRunning(true); + setFailed(false); + const session = keyboardSession(); + const frame = circularFrames(positions); + const ready = await runKeyboardCommand({ kind: "logitechZoneColors", colors: frame(0) }, session); + if (animation.current !== run) return; + if (!ready) { + stop(); + return; + } + const started = performance.now(); + const delay = Math.max(100, period / LOGITECH_RAINBOW_STEPS); + let previousPhase = 0; + async function tick(): Promise { + if (animation.current !== run) return; + const phase = Math.floor((performance.now() - started) * LOGITECH_RAINBOW_STEPS / period) % LOGITECH_RAINBOW_STEPS; + try { + if (phase !== previousPhase) { + await paintLogitechZones(session, frame(phase), false); + previousPhase = phase; + } + } catch { + if (animation.current === run) { + stop(); + setFailed(true); + } + return; + } + if (animation.current === run) run.timer = setTimeout(tick, delay); + } + run.timer = setTimeout(tick, delay); + } + + return
{ + event.preventDefault(); + void start(Number(new FormData(event.currentTarget).get("period"))); + }}> + + {running ? + : } +

{t(locale, "kb.logitechCircularHint")}

+ {failed ?

{t(locale, "kb.readFailed")}

: null} +
; +} + +export default function LogitechPerKeyEffects({ effect, locale, busy, rows, available, initialBase }: { + effect: LogitechPerKeyEffect; locale: InterfaceLocale; busy: boolean; + rows: readonly (readonly { zone: number }[])[]; available: readonly number[]; initialBase: string; +}): ReactNode { + const positions = logitechLedPositions(rows, available); + if (effect === "trail") return zone)} initialBase={initialBase} />; + if (effect === "aurora") return ; + return ; +} diff --git a/src/features/devices/cards/logitech-g915-layout.ts b/src/features/devices/cards/logitech-g915-layout.ts new file mode 100644 index 00000000..64fd734c --- /dev/null +++ b/src/features/devices/cards/logitech-g915-layout.ts @@ -0,0 +1,33 @@ +import { hidKeyForCode } from "../../profiles/hid-keys"; + +// G915 X TKL maps standard USB HID usages to LED IDs. Draw physical positions +// and only render keys that the device included in its presence bitmap. +type Key = { zone: number; label: string }; +const key = (usage: number, label: string): Key => ({ zone: usage - 3, label }); +const letters = (values: string): Key[] => Array.from(values, label => key(label.charCodeAt(0) - 61, label)); +const modifierZone = (index: number): number => 0x68 + index; +const modifier = (index: number, label: string): Key => ({ zone: modifierZone(index), label }); +const modifierCodes: Readonly> = { + ControlLeft: 0, ShiftLeft: 1, AltLeft: 2, MetaLeft: 3, + ControlRight: 4, ShiftRight: 5, AltRight: 6, MetaRight: 7, +}; + +export function g915TrailZoneForCode(code: string, shortcutModifierHeld: boolean): number | null { + if (Object.hasOwn(modifierCodes, code)) return modifierZone(modifierCodes[code]!); + if (shortcutModifierHeld) return null; + const usage = code === "IntlBackslash" ? 0x64 : hidKeyForCode(code); + return usage === null ? null : usage - 3; +} + +function keyboardRows(): Key[][] { + return [ + [key(0x29, "Esc"), ...Array.from({ length: 12 }, (_, index) => key(0x3a + index, `F${index + 1}`)), key(0x46, "PrtSc"), key(0x47, "ScrLk"), key(0x48, "Pause")], + [key(0x35, "`"), ...Array.from({ length: 10 }, (_, index) => key(0x1e + index, String((index + 1) % 10))), key(0x2d, "−"), key(0x2e, "+"), key(0x2a, "⌫"), key(0x49, "Ins"), key(0x4a, "Home"), key(0x4b, "PgUp")], + [key(0x2b, "Tab"), ...letters("QWERTYUIOP"), key(0x2f, "["), key(0x30, "]"), key(0x31, "\\"), key(0x4c, "Del"), key(0x4d, "End"), key(0x4e, "PgDn")], + [key(0x39, "Caps"), ...letters("ASDFGHJKL"), key(0x33, ";"), key(0x34, "'"), key(0x32, "#"), key(0x28, "↵")], + [modifier(1, "Shift"), key(0x64, "<"), ...letters("ZXCVBNM"), key(0x36, ","), key(0x37, "."), key(0x38, "/"), modifier(5, "Shift"), key(0x52, "↑")], + [modifier(0, "Ctrl"), modifier(3, "Win"), modifier(2, "Alt"), key(0x2c, "␣"), modifier(6, "Alt"), modifier(7, "Win"), modifier(4, "Ctrl"), key(0x50, "←"), key(0x51, "↓"), key(0x4f, "→")], + ]; +} +export const G915_ROWS = keyboardRows(); + diff --git a/src/features/devices/cards/logitech-lighting-frames.ts b/src/features/devices/cards/logitech-lighting-frames.ts new file mode 100644 index 00000000..08b7873b --- /dev/null +++ b/src/features/devices/cards/logitech-lighting-frames.ts @@ -0,0 +1,40 @@ +import type { LogitechRgbColor } from "@openmouse/keyboard-protocol/logitech"; + +interface LedPosition { zone: number; x: number; y: number } +type Rows = readonly (readonly { zone: number }[])[]; + +export const LOGITECH_RAINBOW_STEPS = 12; +const rainbow = [ + [255, 0, 0], [255, 128, 0], [255, 255, 0], [128, 255, 0], + [0, 255, 0], [0, 255, 128], [0, 255, 255], [0, 128, 255], + [0, 0, 255], [128, 0, 255], [255, 0, 255], [255, 0, 128], +] as const; + +export function logitechLedPositions(rows: Rows, available: readonly number[]): LedPosition[] { + const present = new Set(available); + return rows.flatMap((row, y) => row.flatMap(({ zone }, x) => present.has(zone) + ? [{ zone, x: x / Math.max(1, row.length - 1), y: y / Math.max(1, rows.length - 1) }] : [])); +} + +export function logitechFormColor(value: FormDataEntryValue | null): LogitechRgbColor { + const rgb = Number.parseInt(String(value).slice(1), 16); + return { red: rgb >> 16, green: (rgb >> 8) & 255, blue: rgb & 255 }; +} + +export function auroraColors(positions: readonly LedPosition[], start: LogitechRgbColor, end: LogitechRgbColor) { + return positions.map(({ zone, x }) => { + const mix = (first: number, last: number) => Math.round(first + (last - first) * x); + return { zone, red: mix(start.red, end.red), green: mix(start.green, end.green), blue: mix(start.blue, end.blue) }; + }); +} + +export function circularFrames(positions: readonly LedPosition[]) { + const bands = positions.map(({ zone, x, y }) => { + const turns = Math.atan2(y - 0.5, (x - 0.5) * 2.4) / (2 * Math.PI); + return { zone, band: Math.round(turns * rainbow.length) + rainbow.length }; + }); + return (phase: number) => bands.map(({ zone, band }) => { + const [red, green, blue] = rainbow[(band + rainbow.length - phase) % rainbow.length]!; + return { zone, red, green, blue }; + }); +} diff --git a/src/features/devices/workspace-tabs.test.ts b/src/features/devices/workspace-tabs.test.ts index b1ba3ec7..0383b9a1 100644 --- a/src/features/devices/workspace-tabs.test.ts +++ b/src/features/devices/workspace-tabs.test.ts @@ -18,6 +18,27 @@ test("HB68 exposes only system mode; Wooting exposes key tuning and global setti assert.ok(availableKeyboardWorkspaceTabs().includes("lighting")); }); +test("Logitech performance tabs follow the controls read from the keyboard", () => { + const noPerformance = { pollingRateHz: null, supportedPollingRates: [], analog: null }; + assert.deepEqual(availableKeyboardWorkspaceTabs("logitech"), ["overview", "lighting"]); + const unavailableTabs = availableKeyboardWorkspaceTabs("logitech", noPerformance); + assert.deepEqual(unavailableTabs, ["overview", "lighting"]); + assert.equal(availableWorkspaceTab("performance", unavailableTabs), "overview"); + + const rates = { ...noPerformance, supportedPollingRates: [125, 1000] }; + assert.ok(!availableKeyboardWorkspaceTabs("logitech", { ...rates, pollingRateHz: 500 }).includes("performance")); + assert.deepEqual(availableKeyboardWorkspaceTabs("logitech", { ...rates, pollingRateHz: 1000 }), [ + "overview", "performance", "lighting", + ]); + + for (const analog of [ + { rapidTrigger: false, keyPriority: null, capabilities: null }, + { rapidTrigger: null, keyPriority: false, capabilities: null }, + ]) { + assert.ok(availableKeyboardWorkspaceTabs("logitech", { ...noPerformance, analog }).includes("performance")); + } +}); + function availability(enabled: Partial): CardAvailability { return new Proxy(enabled, { get: (target, property) => Reflect.get(target, property) ?? false }) as CardAvailability; } diff --git a/src/features/devices/workspace-tabs.ts b/src/features/devices/workspace-tabs.ts index 6384edb4..ce676285 100644 --- a/src/features/devices/workspace-tabs.ts +++ b/src/features/devices/workspace-tabs.ts @@ -1,3 +1,4 @@ +import type { LogitechKeyboardState } from "@openmouse/keyboard-protocol/logitech"; import { WORKSPACE_TAB_ORDER, type WorkspaceTab } from "../../device/types.ts"; import type { CardAvailability } from "./cards/availability.ts"; @@ -29,12 +30,32 @@ export function availableWorkspaceTab( return tabs.includes(current) ? current : "overview"; } -export function availableKeyboardWorkspaceTabs(family?: string): readonly WorkspaceTab[] { +type LogitechPerformanceValues = Pick; + +export function logitechPerformanceControls(status?: LogitechPerformanceValues | null) { + const hz = status?.pollingRateHz; + const rates = status?.supportedPollingRates ?? []; + return { + polling: hz != null && rates.includes(hz) ? { hz, rates } : null, + rapidTrigger: status?.analog?.rapidTrigger ?? null, + keyPriority: status?.analog?.keyPriority ?? null, + }; +} + +export function availableKeyboardWorkspaceTabs(family?: string, logitech?: LogitechPerformanceValues & Pick | null): readonly WorkspaceTab[] { if (family === "kochi") return ["overview"]; if (family === "keychron") return ["overview", "performance", "buttons", "profiles", "advanced"]; if (family === "wooting") return ["overview", "performance", "lighting", "profiles", "advanced"]; if (family === "razer") return ["overview", "performance", "lighting"]; - if (family === "logitech") return ["overview", "performance", "lighting"]; + if (family === "logitech") { + const { polling, rapidTrigger, keyPriority } = logitechPerformanceControls(logitech); + const tabs: WorkspaceTab[] = ["overview"]; + if (polling || rapidTrigger !== null || keyPriority !== null) tabs.push("performance"); + tabs.push("lighting"); + if (logitech?.gameMode) tabs.push("gameMode"); + if (logitech?.onboardMemory) tabs.push("profiles"); + return tabs; + } if (family === "steelseries") return ["overview", "performance", "lighting", "profiles"]; if (family === "arbiter") return ["overview", "performance", "buttons", "lighting"]; if (family === "glorious") return ["overview", "performance", "buttons", "macro"]; diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 46afc4d7..0e10a83b 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -211,6 +211,38 @@ const en = { "tab.profiles": "Profiles", "tab.advanced": "Advanced", "tab.lighting": "Lighting", + "tab.gameMode": "Game Mode", + "kb.logitechGameModeHint": "Select extra keys to block. Toggle Game Mode on your keyboard.", + "kb.logitechGameModeReplace": "Apply replaces the custom list. This browser remembers your selection.", + "kb.logitechGameModeFixed": "Blocked by default", + "kb.logitechGameModeClear": "Clear selection", + "kb.logitechGameModeMenu": "Menu", + "kb.logitechOnboardTitle": "Onboard memory", + "kb.logitechOnboardHint": "Use Fn + F2, Fn + F3 or Fn + F4 to switch profiles in onboard mode.", + "kb.logitechOnboardActiveSlot": "Active slot {n}", + "kb.logitechOnboardOff": "Onboard mode off", + "kb.logitechOnboardName": "Profile name", + "kb.logitechOnboardLighting": "Key lighting", + "kb.logitechOnboardKeep": "Keep saved effect", + "kb.logitechOnboardGameMode": "Copy OpenMouse’s last Game Mode selection", + "kb.logitechOnboardTimers": "The lights must turn off at or after dimming.", + "kb.logitechOnboardActivate": "Activate slot", + "kb.logitechOnboardLeave": "Leave onboard mode", + "kb.logitechOnboardExtraLighting": "Logo and sleep lighting", + "kb.logitechOnboardIdleKeys": "Keys during sleep", + "kb.logitechOnboardIdleLogo": "Logo during sleep", + "kb.logitechOnboardSourceKey": "Key to remap", + "kb.logitechOnboardTargetKey": "Output key", + "kb.logitechOnboardOriginalKey": "Original key", + "kb.logitechOnboardAssignmentHint": "Save a base layer key or shortcut. Fn + F1 toggles key customization.", + "kb.logitechOnboardAnimations": "Stored lighting", + "kb.logitechOnboardAnimationHint": "Save an effect to the keyboard, then pick it in a profile or use its shortcut.", + "kb.logitechOnboardAnimationSlot": "Effect slot", + "kb.logitechOnboardAnimationName": "Effect name", + "kb.logitechOnboardAnimationShortcut": "Brightness + {n}", + "kb.logitechOnboardFixedKeys": "Per-key colors", + "kb.logitechOnboardPaint": "Paint color", + "kb.logitechOnboardAnimationReplace": "Replace the stored effect", "ov.battery": "BATTERY", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Firmware reported by mouse", @@ -1787,6 +1819,51 @@ const en = { "kb.readingTrigger": "Reading per-key triggers…", "kb.applying": "Applying…", "kb.readFailed": "Unable to read the keyboard.", + "kb.logitechPresets": "Color presets", + "kb.logitechLogo": "Logo", + "kb.logitechIdleBrightness": "Idle brightness (%)", + "kb.logitechIdleAfter": "Start idle effect after (seconds)", + "kb.logitechStartup": "Startup effect", + "kb.logitechPrimaryColor": "First color", + "kb.logitechSecondaryColor": "Second color", + "kb.logitechMoreControls": "More lighting controls", + "kb.logitechLightingUnavailable": "No lighting settings were read. Refresh from the keyboard to try again.", + "kb.logitechZoneEditor": "Per-key lighting", + "kb.logitechOtherZones": "Additional firmware LEDs", + "kb.logitechFirmwareLedsHint": "The TKL has no number pad. Firmware can also report LED positions with no matching physical key.", + "kb.logitechNumpad": "Numpad {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Rainbow wave", + "kb.logitechColorCycle": "Color cycle", + "kb.logitechKeyRipple": "Keypress ripple", + "kb.logitechEffectPeriod": "Speed · period (ms)", + "kb.logitechWaveDirection": "Wave direction", + "kb.logitechWaveRight": "Left to right", + "kb.logitechWaveCenterOut": "From the center", + "kb.logitechWaveCenterIn": "Toward the center", + "kb.logitechWaveDown": "Top to bottom", + "kb.logitechAurora": "Two-color Aurora gradient", + "kb.logitechTrailStart": "Key trail", + "kb.logitechTrailDuration": "Trail duration (ms)", + "kb.logitechTrailCapture": "Type here", + "kb.logitechTrailMode": "Key trail", + "kb.logitechTrailBase": "Base color", + "kb.logitechTrailColor": "Keypress color", + "kb.logitechTrailHint": "Each key returns to its base color. Keep focus in the test field.", + "kb.logitechCircularRainbow": "Circular rainbow", + "kb.logitechCircularHint": "Keep OpenMouse open to run the animation.", + "kb.logitechZoneNumber": "Zone {n}", + "kb.logitechClusterEffects": "Effects by zone", + "kb.logitechTargetZone": "Lighting zone", + "kb.logitechAllZones": "All zones", + "kb.logitechEffectWhen": "Apply effect during", + "kb.logitechEffectActive": "Active use", + "kb.logitechInactivity": "Inactivity lighting", + "kb.logitechDimAfter": "Dim after inactivity (seconds)", + "kb.logitechLightsOffAfter": "Turn lights off on inactivity (seconds)", + "kb.logitechNever": "Never", + "kb.logitechTimerHint": "Leave a timer blank to disable it.", + "kb.logitechPerformanceReadFailed": "Some performance settings could not be read. Refresh from the keyboard to try again.", "kb.connFailed": "Keyboard connection failed", "kb.connectedTo": "Connected to {name}", "kb.identityFirmware": "Firmware", diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index c00e0662..eabad7a2 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -155,6 +155,38 @@ export const ar: Record = { "tab.profiles": "الملفات الشخصية", "tab.advanced": "متقدم", "tab.lighting": "الإضاءة", + "tab.gameMode": "وضع اللعب", + "kb.logitechGameModeHint": "اختر المفاتيح الإضافية التي تريد تعطيلها. استخدم زر وضع اللعب على لوحة المفاتيح للتشغيل والإيقاف.", + "kb.logitechGameModeReplace": "يستبدل التطبيق قائمة المفاتيح المخصصة في لوحة المفاتيح. يعرض OpenMouse آخر اختيار في هذا المتصفح.", + "kb.logitechGameModeFixed": "معطّل افتراضيًا", + "kb.logitechGameModeClear": "مسح الاختيار", + "kb.logitechGameModeMenu": "القائمة", + "kb.logitechOnboardTitle": "الذاكرة الداخلية", + "kb.logitechOnboardHint": "استخدم Fn + F2 أو Fn + F3 أو Fn + F4 للتبديل بين الملفات في وضع الذاكرة الداخلية.", + "kb.logitechOnboardActiveSlot": "الخانة النشطة {n}", + "kb.logitechOnboardOff": "وضع الذاكرة الداخلية متوقف", + "kb.logitechOnboardName": "اسم الملف", + "kb.logitechOnboardLighting": "إضاءة المفاتيح", + "kb.logitechOnboardKeep": "الاحتفاظ بالتأثير المحفوظ", + "kb.logitechOnboardGameMode": "نسخ آخر اختيار لوضع اللعب في OpenMouse", + "kb.logitechOnboardTimers": "يجب إطفاء الإضاءة عند التعتيم أو بعده.", + "kb.logitechOnboardActivate": "تفعيل الخانة", + "kb.logitechOnboardLeave": "مغادرة وضع الذاكرة الداخلية", + "kb.logitechOnboardExtraLighting": "الشعار وإضاءة السكون", + "kb.logitechOnboardIdleKeys": "المفاتيح أثناء السكون", + "kb.logitechOnboardIdleLogo": "الشعار أثناء السكون", + "kb.logitechOnboardSourceKey": "المفتاح المراد تعيينه", + "kb.logitechOnboardTargetKey": "مفتاح الإخراج", + "kb.logitechOnboardOriginalKey": "المفتاح الأصلي", + "kb.logitechOnboardAssignmentHint": "احفظ مفتاحًا أو اختصارًا في الطبقة الأساسية. يبدّل Fn + F1 تخصيص المفاتيح.", + "kb.logitechOnboardAnimations": "الإضاءة المحفوظة", + "kb.logitechOnboardAnimationHint": "احفظ تأثيرًا على لوحة المفاتيح ثم اختره في ملف تعريف أو استخدم اختصاره.", + "kb.logitechOnboardAnimationSlot": "خانة الإضاءة", + "kb.logitechOnboardAnimationName": "اسم التأثير", + "kb.logitechOnboardAnimationShortcut": "السطوع + {n}", + "kb.logitechOnboardFixedKeys": "ألوان لكل مفتاح", + "kb.logitechOnboardPaint": "لون الطلاء", + "kb.logitechOnboardAnimationReplace": "استبدال التأثير المحفوظ", "ov.battery": "البطارية", "ov.firmware": "البرنامج الثابت", "ov.fwSingle": "البرنامج الثابت المُبلَّغ من الماوس", @@ -1656,6 +1688,51 @@ export const ar: Record = { "kb.readingTrigger": "جارٍ قراءة نقط التفعيل لكل مفتاح…", "kb.applying": "جارٍ التطبيق…", "kb.readFailed": "تعذّرت قراءة لوحة المفاتيح.", + "kb.logitechPresets": "ألوان جاهزة", + "kb.logitechLogo": "الشعار", + "kb.logitechIdleBrightness": "سطوع الخمول (%)", + "kb.logitechIdleAfter": "بدء تأثير الخمول بعد (ثوانٍ)", + "kb.logitechStartup": "تأثير بدء التشغيل", + "kb.logitechPrimaryColor": "اللون الأول", + "kb.logitechSecondaryColor": "اللون الثاني", + "kb.logitechMoreControls": "مزيد من إعدادات الإضاءة", + "kb.logitechLightingUnavailable": "تعذّرت قراءة إعدادات الإضاءة. أعد القراءة من لوحة المفاتيح للمحاولة مجددًا.", + "kb.logitechZoneEditor": "إضاءة كل مفتاح", + "kb.logitechOtherZones": "مصابيح إضافية من البرنامج الثابت", + "kb.logitechFirmwareLedsHint": "لا يحتوي TKL على لوحة أرقام. قد يبلغ البرنامج الثابت أيضًا عن مواضع إضاءة بلا مفتاح فعلي مقابل.", + "kb.logitechNumpad": "لوحة الأرقام {key}", + "kb.logitechLedId": "مصباح {id}", + "kb.logitechRainbowWave": "موجة قوس قزح", + "kb.logitechColorCycle": "تبديل الألوان", + "kb.logitechKeyRipple": "تموج عند الضغط", + "kb.logitechEffectPeriod": "السرعة · المدة (مللي ثانية)", + "kb.logitechWaveDirection": "اتجاه الموجة", + "kb.logitechWaveRight": "من اليسار إلى اليمين", + "kb.logitechWaveCenterOut": "من المركز إلى الخارج", + "kb.logitechWaveCenterIn": "باتجاه المركز", + "kb.logitechWaveDown": "من الأعلى إلى الأسفل", + "kb.logitechAurora": "تدرج الشفق بلونين", + "kb.logitechTrailStart": "تشغيل أثر المفاتيح", + "kb.logitechTrailDuration": "مدة الأثر (مللي ثانية)", + "kb.logitechTrailCapture": "اكتب هنا", + "kb.logitechTrailMode": "أثر المفاتيح", + "kb.logitechTrailBase": "اللون الأساسي", + "kb.logitechTrailColor": "لون الضغط", + "kb.logitechTrailHint": "يعود كل مفتاح إلى لونه الأساسي. أبقِ التركيز على حقل الاختبار.", + "kb.logitechCircularRainbow": "قوس قزح دائري", + "kb.logitechCircularHint": "أبقِ OpenMouse مفتوحًا لتستمر الحركة.", + "kb.logitechZoneNumber": "المنطقة {n}", + "kb.logitechClusterEffects": "تأثيرات حسب المنطقة", + "kb.logitechTargetZone": "منطقة الإضاءة", + "kb.logitechAllZones": "كل المناطق", + "kb.logitechEffectWhen": "تطبيق التأثير أثناء", + "kb.logitechEffectActive": "الاستخدام النشط", + "kb.logitechInactivity": "الإضاءة عند الخمول", + "kb.logitechDimAfter": "التعتيم بعد الخمول (ثوانٍ)", + "kb.logitechLightsOffAfter": "إطفاء الإضاءة عند الخمول (ثوانٍ)", + "kb.logitechNever": "أبدًا", + "kb.logitechTimerHint": "اترك خانة المؤقت فارغة لتعطيله.", + "kb.logitechPerformanceReadFailed": "تعذّرت قراءة بعض إعدادات الأداء. حدّث البيانات من لوحة المفاتيح للمحاولة مجددًا.", "kb.connFailed": "فشل الاتصال بلوحة المفاتيح", "kb.connectedTo": "متصل بـ {name}", "kb.identityFirmware": "البرنامج الثابت", diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 1d220e22..b1d9631c 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -155,6 +155,38 @@ export const de: Record = { "tab.profiles": "Profile", "tab.advanced": "Erweitert", "tab.lighting": "Beleuchtung", + "tab.gameMode": "Spielmodus", + "kb.logitechGameModeHint": "Wähle die zusätzlichen Tasten aus, die gesperrt werden sollen. Nutze zum Ein- und Ausschalten die Spielmodus-Taste.", + "kb.logitechGameModeReplace": "Beim Anwenden wird die benutzerdefinierte Sperrliste überschrieben. OpenMouse zeigt die letzte Auswahl dieses Browsers.", + "kb.logitechGameModeFixed": "Standardmäßig gesperrt", + "kb.logitechGameModeClear": "Auswahl leeren", + "kb.logitechGameModeMenu": "Menü", + "kb.logitechOnboardTitle": "Integrierter Speicher", + "kb.logitechOnboardHint": "Wechsle im Speichermodus mit Fn + F2, Fn + F3 oder Fn + F4 zwischen den Profilen.", + "kb.logitechOnboardActiveSlot": "Aktiver Speicherplatz {n}", + "kb.logitechOnboardOff": "Speichermodus aus", + "kb.logitechOnboardName": "Profilname", + "kb.logitechOnboardLighting": "Tastenbeleuchtung", + "kb.logitechOnboardKeep": "Gespeicherten Effekt beibehalten", + "kb.logitechOnboardGameMode": "Letzte Spielmodus-Auswahl von OpenMouse übernehmen", + "kb.logitechOnboardTimers": "Das Licht muss beim Dimmen oder danach ausgehen.", + "kb.logitechOnboardActivate": "Speicherplatz aktivieren", + "kb.logitechOnboardLeave": "Speichermodus beenden", + "kb.logitechOnboardExtraLighting": "Logo und Ruhebeleuchtung", + "kb.logitechOnboardIdleKeys": "Tasten im Ruhezustand", + "kb.logitechOnboardIdleLogo": "Logo im Ruhezustand", + "kb.logitechOnboardSourceKey": "Neu zu belegende Taste", + "kb.logitechOnboardTargetKey": "Zieltaste", + "kb.logitechOnboardOriginalKey": "Ursprüngliche Taste", + "kb.logitechOnboardAssignmentHint": "Speichere eine Taste oder einen Kurzbefehl auf der Basisebene. Fn + F1 schaltet die Belegung um.", + "kb.logitechOnboardAnimations": "Gespeicherte Beleuchtung", + "kb.logitechOnboardAnimationHint": "Speichere einen Effekt auf der Tastatur und wähle ihn im Profil oder per Tastenkürzel.", + "kb.logitechOnboardAnimationSlot": "Effektspeicherplatz", + "kb.logitechOnboardAnimationName": "Effektname", + "kb.logitechOnboardAnimationShortcut": "Helligkeit + {n}", + "kb.logitechOnboardFixedKeys": "Farben pro Taste", + "kb.logitechOnboardPaint": "Mal­farbe", + "kb.logitechOnboardAnimationReplace": "Gespeicherten Effekt ersetzen", "ov.battery": "AKKU", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Von der Maus gemeldete Firmware", @@ -1686,6 +1718,51 @@ export const de: Record = { "kb.readingTrigger": "Auslösepunkte pro Taste werden gelesen…", "kb.applying": "Wird angewendet…", "kb.readFailed": "Die Tastatur konnte nicht gelesen werden.", + "kb.logitechPresets": "Farbvorlagen", + "kb.logitechLogo": "Logo", + "kb.logitechIdleBrightness": "Helligkeit im Leerlauf (%)", + "kb.logitechIdleAfter": "Leerlaufeffekt starten nach (Sekunden)", + "kb.logitechStartup": "Starteffekt", + "kb.logitechPrimaryColor": "Erste Farbe", + "kb.logitechSecondaryColor": "Zweite Farbe", + "kb.logitechMoreControls": "Weitere Beleuchtungseinstellungen", + "kb.logitechLightingUnavailable": "Die Beleuchtungseinstellungen konnten nicht gelesen werden. Lies die Tastatur erneut aus.", + "kb.logitechZoneEditor": "Einzeltastenbeleuchtung", + "kb.logitechOtherZones": "Zusätzliche Firmware-LEDs", + "kb.logitechFirmwareLedsHint": "Das TKL hat keinen Ziffernblock. Die Firmware kann auch LED-Positionen ohne entsprechende physische Taste melden.", + "kb.logitechNumpad": "Ziffernblock {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Regenbogenwelle", + "kb.logitechColorCycle": "Farbwechsel", + "kb.logitechKeyRipple": "Wellen beim Tastendruck", + "kb.logitechEffectPeriod": "Geschwindigkeit · Periode (ms)", + "kb.logitechWaveDirection": "Wellenrichtung", + "kb.logitechWaveRight": "Von links nach rechts", + "kb.logitechWaveCenterOut": "Von der Mitte nach außen", + "kb.logitechWaveCenterIn": "Zur Mitte hin", + "kb.logitechWaveDown": "Von oben nach unten", + "kb.logitechAurora": "Zweifarbiger Aurora-Verlauf", + "kb.logitechTrailStart": "Tastenspur starten", + "kb.logitechTrailDuration": "Spurdauer (ms)", + "kb.logitechTrailCapture": "Hier tippen", + "kb.logitechTrailMode": "Tastenspur", + "kb.logitechTrailBase": "Grundfarbe", + "kb.logitechTrailColor": "Farbe beim Tastendruck", + "kb.logitechTrailHint": "Jede Taste kehrt zur Grundfarbe zurück. Lass den Fokus im Testfeld.", + "kb.logitechCircularRainbow": "Kreisender Regenbogen", + "kb.logitechCircularHint": "Lass OpenMouse geöffnet, damit die Animation weiterläuft.", + "kb.logitechZoneNumber": "Zone {n}", + "kb.logitechClusterEffects": "Effekte nach Zone", + "kb.logitechTargetZone": "Beleuchtungszone", + "kb.logitechAllZones": "Alle Zonen", + "kb.logitechEffectWhen": "Effekt verwenden bei", + "kb.logitechEffectActive": "Aktiver Nutzung", + "kb.logitechInactivity": "Beleuchtung bei Inaktivität", + "kb.logitechDimAfter": "Nach Inaktivität dimmen (Sekunden)", + "kb.logitechLightsOffAfter": "Bei Inaktivität ausschalten (Sekunden)", + "kb.logitechNever": "Nie", + "kb.logitechTimerHint": "Lass einen Timer leer, um ihn zu deaktivieren.", + "kb.logitechPerformanceReadFailed": "Einige Leistungseinstellungen konnten nicht gelesen werden. Lade die Daten erneut von der Tastatur.", "kb.connFailed": "Tastaturverbindung fehlgeschlagen", "kb.connectedTo": "Verbunden mit {name}", "kb.identityFirmware": "Firmware", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 75e0036d..5bc83798 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -155,6 +155,38 @@ export const es: Record = { "tab.profiles": "Perfiles", "tab.advanced": "Avanzado", "tab.lighting": "Iluminación", + "tab.gameMode": "Modo juego", + "kb.logitechGameModeHint": "Selecciona las teclas adicionales que quieres bloquear. Activa o desactiva el modo con el botón del teclado.", + "kb.logitechGameModeReplace": "Al aplicar se sustituye la lista de bloqueos personalizados del teclado. OpenMouse muestra su última selección en este navegador.", + "kb.logitechGameModeFixed": "Bloqueada de fábrica", + "kb.logitechGameModeClear": "Limpiar selección", + "kb.logitechGameModeMenu": "Menú", + "kb.logitechOnboardTitle": "Memoria interna", + "kb.logitechOnboardHint": "En modo memoria interna, cambia de perfil con Fn + F2, Fn + F3 o Fn + F4.", + "kb.logitechOnboardActiveSlot": "Ranura activa {n}", + "kb.logitechOnboardOff": "Modo memoria interna desactivado", + "kb.logitechOnboardName": "Nombre del perfil", + "kb.logitechOnboardLighting": "Iluminación de las teclas", + "kb.logitechOnboardKeep": "Conservar el efecto guardado", + "kb.logitechOnboardGameMode": "Copiar la última selección de Modo juego de OpenMouse", + "kb.logitechOnboardTimers": "El apagado debe ser a la vez que la atenuación o después.", + "kb.logitechOnboardActivate": "Activar ranura", + "kb.logitechOnboardLeave": "Salir del modo memoria interna", + "kb.logitechOnboardExtraLighting": "Logotipo y luz en reposo", + "kb.logitechOnboardIdleKeys": "Teclas en reposo", + "kb.logitechOnboardIdleLogo": "Logotipo en reposo", + "kb.logitechOnboardSourceKey": "Tecla que quieres reasignar", + "kb.logitechOnboardTargetKey": "Tecla de salida", + "kb.logitechOnboardOriginalKey": "Tecla original", + "kb.logitechOnboardAssignmentHint": "Guarda una tecla o un atajo en la capa base. Fn + F1 activa o desactiva las asignaciones.", + "kb.logitechOnboardAnimations": "Iluminación guardada", + "kb.logitechOnboardAnimationHint": "Guarda un efecto en el teclado y elígelo en un perfil o reprodúcelo con su atajo.", + "kb.logitechOnboardAnimationSlot": "Ranura de iluminación", + "kb.logitechOnboardAnimationName": "Nombre del efecto", + "kb.logitechOnboardAnimationShortcut": "Brillo + {n}", + "kb.logitechOnboardFixedKeys": "Colores por tecla", + "kb.logitechOnboardPaint": "Color para pintar", + "kb.logitechOnboardAnimationReplace": "Sustituir el efecto guardado", "ov.battery": "BATERÍA", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Firmware reportado por el mouse", @@ -1658,6 +1690,59 @@ export const es: Record = { "kb.readingTrigger": "Leyendo los gatillos por tecla…", "kb.applying": "Aplicando…", "kb.readFailed": "No se pudo leer el teclado.", + "kb.logitechStaticBlack": "Fijo (negro)", + "kb.logitechred": "Rojo", + "kb.logitechgreen": "Verde", + "kb.logitechblue": "Azul", + "kb.logitechRgbEffect": "Efecto RGB", + "kb.logitechRgbNoReadback": "El teclado no informa del efecto RGB activo.", + "kb.logitechSolidColor": "Color fijo", + "kb.logitechColorNoReadback": "El teclado confirma la aplicación del color, pero no informa del color actual.", + "kb.logitechPresets": "Colores predefinidos", + "kb.logitechLogo": "Logotipo", + "kb.logitechIdleBrightness": "Brillo en reposo (%)", + "kb.logitechIdleAfter": "Iniciar el efecto de reposo tras (segundos)", + "kb.logitechStartup": "Efecto de inicio", + "kb.logitechPrimaryColor": "Primer color", + "kb.logitechSecondaryColor": "Segundo color", + "kb.logitechMoreControls": "Más controles de iluminación", + "kb.logitechLightingUnavailable": "No se pudieron leer los ajustes de iluminación. Vuelve a leer el teclado para intentarlo.", + "kb.logitechZoneEditor": "Iluminación por tecla", + "kb.logitechOtherZones": "LED adicionales del firmware", + "kb.logitechFirmwareLedsHint": "El TKL carece de teclado numérico. El firmware también puede anunciar posiciones LED sin una tecla física asociada.", + "kb.logitechNumpad": "Numérico {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Onda arcoíris", + "kb.logitechColorCycle": "Ciclo de colores", + "kb.logitechKeyRipple": "Ondas al pulsar", + "kb.logitechEffectPeriod": "Velocidad · periodo (ms)", + "kb.logitechWaveDirection": "Dirección de la onda", + "kb.logitechWaveRight": "De izquierda a derecha", + "kb.logitechWaveCenterOut": "Desde el centro", + "kb.logitechWaveCenterIn": "Hacia el centro", + "kb.logitechWaveDown": "De arriba abajo", + "kb.logitechAurora": "Degradado Aurora bicolor", + "kb.logitechTrailStart": "Activar rastro", + "kb.logitechTrailDuration": "Duración del rastro (ms)", + "kb.logitechTrailCapture": "Pulsa las teclas aquí", + "kb.logitechTrailMode": "Rastro de teclas", + "kb.logitechTrailBase": "Color base", + "kb.logitechTrailColor": "Color de la pulsación", + "kb.logitechTrailHint": "Cada tecla vuelve a su color base. Mantén el foco en el campo de prueba.", + "kb.logitechCircularRainbow": "Arcoíris circular", + "kb.logitechCircularHint": "Mantén OpenMouse abierto para que siga la animación.", + "kb.logitechZoneNumber": "Zona {n}", + "kb.logitechClusterEffects": "Efectos por zona", + "kb.logitechTargetZone": "Zona de iluminación", + "kb.logitechAllZones": "Todas las zonas", + "kb.logitechEffectWhen": "Aplicar el efecto durante", + "kb.logitechEffectActive": "Uso activo", + "kb.logitechInactivity": "Iluminación en reposo", + "kb.logitechDimAfter": "Atenuar tras inactividad (segundos)", + "kb.logitechLightsOffAfter": "Apagar las luces por inactividad (segundos)", + "kb.logitechNever": "Nunca", + "kb.logitechTimerHint": "Deja un temporizador vacío para desactivarlo.", + "kb.logitechPerformanceReadFailed": "No se pudieron leer algunos ajustes de rendimiento. Actualiza los datos del teclado para volver a intentarlo.", "kb.connFailed": "Error al conectar el teclado", "kb.connectedTo": "Conectado a {name}", "kb.identityFirmware": "Firmware", @@ -1671,7 +1756,7 @@ export const es: Record = { "kb.pollingDetail": "El teclado ahora sondea a {hz} Hz.", "kb.pollingFailed": "No se pudo definir la tasa de sondeo", "kb.triggerTitle": "Gatillo por tecla", - "kb.selectionHint": "Click keys to select them. Click again to deselect.", + "kb.selectionHint": "Pulsa las teclas para seleccionarlas. Pulsa de nuevo para quitar la selección.", "kb.tuningTitle": "Tune your keys", "kb.valuesFor": "Showing {key} values · changes apply to every selected key", "kb.actuationGroup": "Actuation", @@ -1711,7 +1796,7 @@ export const es: Record = { "kb.sleep": "Sleep timer (seconds, 0 = off)", "kb.shake": "Shake optimization", "kb.slot": "Configuration slot", - "kb.refresh": "Refresh from keyboard", + "kb.refresh": "Volver a leer el teclado", "kb.apply": "Apply", "kb.save": "Save to keyboard", "kb.saveNote": "Save the selected settings from RAM to onboard flash.", @@ -1746,7 +1831,7 @@ export const es: Record = { "kb.correction": "Colour correction", "kb.palette": "Palette", "kb.blackout": "Blackout", - "kb.brightness": "Brightness", + "kb.brightness": "Brillo", "kb.speed": "Speed", "kb.direction": "Direction", "kb.staticColor": "Static palette index", @@ -1772,7 +1857,7 @@ export const es: Record = { "kb.all": "All settings", "kb.layout": "Key layout", "kb.performance": "Performance", - "kb.lighting": "Lighting", + "kb.lighting": "Iluminación", "kb.macro": "Macros", "kb.higherKey": "Advanced keys", "kb.unavailable": "Not reported", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 588d658c..cdb1af33 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -155,6 +155,38 @@ export const fr: Record = { "tab.profiles": "Profils", "tab.advanced": "Avancé", "tab.lighting": "Éclairage", + "tab.gameMode": "Mode jeu", + "kb.logitechGameModeHint": "Sélectionnez les touches supplémentaires à bloquer. Activez ou désactivez le mode avec le bouton du clavier.", + "kb.logitechGameModeReplace": "Appliquer remplace la liste personnalisée du clavier. OpenMouse affiche sa dernière sélection dans ce navigateur.", + "kb.logitechGameModeFixed": "Bloquée par défaut", + "kb.logitechGameModeClear": "Effacer la sélection", + "kb.logitechGameModeMenu": "Menu", + "kb.logitechOnboardTitle": "Mémoire intégrée", + "kb.logitechOnboardHint": "En mode mémoire intégrée, changez de profil avec Fn + F2, Fn + F3 ou Fn + F4.", + "kb.logitechOnboardActiveSlot": "Emplacement actif {n}", + "kb.logitechOnboardOff": "Mode mémoire intégrée désactivé", + "kb.logitechOnboardName": "Nom du profil", + "kb.logitechOnboardLighting": "Éclairage des touches", + "kb.logitechOnboardKeep": "Conserver l’effet enregistré", + "kb.logitechOnboardGameMode": "Copier la dernière sélection du mode jeu d’OpenMouse", + "kb.logitechOnboardTimers": "L’éclairage doit s’éteindre au moment de la réduction de luminosité ou après.", + "kb.logitechOnboardActivate": "Activer l’emplacement", + "kb.logitechOnboardLeave": "Quitter le mode mémoire intégrée", + "kb.logitechOnboardExtraLighting": "Logo et éclairage de veille", + "kb.logitechOnboardIdleKeys": "Touches en veille", + "kb.logitechOnboardIdleLogo": "Logo en veille", + "kb.logitechOnboardSourceKey": "Touche à réaffecter", + "kb.logitechOnboardTargetKey": "Touche de sortie", + "kb.logitechOnboardOriginalKey": "Touche d’origine", + "kb.logitechOnboardAssignmentHint": "Enregistrez une touche ou un raccourci dans la couche de base. Fn + F1 bascule les affectations.", + "kb.logitechOnboardAnimations": "Éclairage enregistré", + "kb.logitechOnboardAnimationHint": "Enregistrez un effet sur le clavier, puis choisissez-le dans un profil ou utilisez son raccourci.", + "kb.logitechOnboardAnimationSlot": "Emplacement d’effet", + "kb.logitechOnboardAnimationName": "Nom de l’effet", + "kb.logitechOnboardAnimationShortcut": "Luminosité + {n}", + "kb.logitechOnboardFixedKeys": "Couleurs par touche", + "kb.logitechOnboardPaint": "Couleur à appliquer", + "kb.logitechOnboardAnimationReplace": "Remplacer l’effet enregistré", "ov.battery": "BATTERIE", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Firmware signalé par la souris", @@ -1658,6 +1690,51 @@ export const fr: Record = { "kb.readingTrigger": "Lecture des déclenchements par touche…", "kb.applying": "Application…", "kb.readFailed": "Impossible de lire le clavier.", + "kb.logitechPresets": "Couleurs prédéfinies", + "kb.logitechLogo": "Logo", + "kb.logitechIdleBrightness": "Luminosité au repos (%)", + "kb.logitechIdleAfter": "Démarrer l’effet au repos après (secondes)", + "kb.logitechStartup": "Effet de démarrage", + "kb.logitechPrimaryColor": "Première couleur", + "kb.logitechSecondaryColor": "Deuxième couleur", + "kb.logitechMoreControls": "Autres réglages d’éclairage", + "kb.logitechLightingUnavailable": "Impossible de lire les réglages d’éclairage. Relisez le clavier pour réessayer.", + "kb.logitechZoneEditor": "Éclairage par touche", + "kb.logitechOtherZones": "LED supplémentaires du micrologiciel", + "kb.logitechFirmwareLedsHint": "Le TKL ne possède pas de pavé numérique. Le micrologiciel peut aussi signaler des LED sans touche physique correspondante.", + "kb.logitechNumpad": "Pavé numérique {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Vague arc-en-ciel", + "kb.logitechColorCycle": "Cycle de couleurs", + "kb.logitechKeyRipple": "Ondes à la frappe", + "kb.logitechEffectPeriod": "Vitesse · période (ms)", + "kb.logitechWaveDirection": "Direction de la vague", + "kb.logitechWaveRight": "De gauche à droite", + "kb.logitechWaveCenterOut": "Depuis le centre", + "kb.logitechWaveCenterIn": "Vers le centre", + "kb.logitechWaveDown": "De haut en bas", + "kb.logitechAurora": "Dégradé Aurore bicolore", + "kb.logitechTrailStart": "Activer la traînée", + "kb.logitechTrailDuration": "Durée de la traînée (ms)", + "kb.logitechTrailCapture": "Tapez ici", + "kb.logitechTrailMode": "Traînée de touches", + "kb.logitechTrailBase": "Couleur de base", + "kb.logitechTrailColor": "Couleur à la frappe", + "kb.logitechTrailHint": "Chaque touche retrouve sa couleur de base. Garde le focus dans le champ de test.", + "kb.logitechCircularRainbow": "Arc-en-ciel circulaire", + "kb.logitechCircularHint": "Laisse OpenMouse ouvert pour poursuivre l’animation.", + "kb.logitechZoneNumber": "Zone {n}", + "kb.logitechClusterEffects": "Effets par zone", + "kb.logitechTargetZone": "Zone d’éclairage", + "kb.logitechAllZones": "Toutes les zones", + "kb.logitechEffectWhen": "Appliquer l’effet pendant", + "kb.logitechEffectActive": "Utilisation active", + "kb.logitechInactivity": "Éclairage en veille", + "kb.logitechDimAfter": "Atténuer après inactivité (secondes)", + "kb.logitechLightsOffAfter": "Éteindre les lumières en cas d’inactivité (secondes)", + "kb.logitechNever": "Jamais", + "kb.logitechTimerHint": "Laissez une durée vide pour la désactiver.", + "kb.logitechPerformanceReadFailed": "Certains réglages de performances n’ont pas pu être lus. Actualisez les données du clavier pour réessayer.", "kb.connFailed": "Échec de la connexion du clavier", "kb.connectedTo": "Connecté à {name}", "kb.identityFirmware": "Firmware", diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 9177612b..ab9123c1 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -155,6 +155,38 @@ export const ja: Record = { "tab.profiles": "プロファイル", "tab.advanced": "詳細設定", "tab.lighting": "ライティング", + "tab.gameMode": "ゲームモード", + "kb.logitechGameModeHint": "無効にするキーを追加で選択します。ゲームモードの切り替えにはキーボードのボタンを使います。", + "kb.logitechGameModeReplace": "適用すると、キーボードのカスタムリストが置き換わります。OpenMouse はこのブラウザーでの前回の選択を表示します。", + "kb.logitechGameModeFixed": "既定で無効", + "kb.logitechGameModeClear": "選択を解除", + "kb.logitechGameModeMenu": "メニュー", + "kb.logitechOnboardTitle": "オンボードメモリ", + "kb.logitechOnboardHint": "オンボードモードでは Fn + F2、Fn + F3、Fn + F4 でプロファイルを切り替えます。", + "kb.logitechOnboardActiveSlot": "使用中のスロット {n}", + "kb.logitechOnboardOff": "オンボードモードはオフ", + "kb.logitechOnboardName": "プロファイル名", + "kb.logitechOnboardLighting": "キーの照明", + "kb.logitechOnboardKeep": "保存済みの効果を保持", + "kb.logitechOnboardGameMode": "OpenMouse の前回のゲームモード設定をコピー", + "kb.logitechOnboardTimers": "消灯時間は減光時間以上にしてください。", + "kb.logitechOnboardActivate": "スロットを有効化", + "kb.logitechOnboardLeave": "オンボードモードを終了", + "kb.logitechOnboardExtraLighting": "ロゴとスリープ時の照明", + "kb.logitechOnboardIdleKeys": "スリープ時のキー", + "kb.logitechOnboardIdleLogo": "スリープ時のロゴ", + "kb.logitechOnboardSourceKey": "変更するキー", + "kb.logitechOnboardTargetKey": "出力キー", + "kb.logitechOnboardOriginalKey": "元のキー", + "kb.logitechOnboardAssignmentHint": "基本レイヤーにキーやショートカットを保存します。Fn + F1 で割り当てを切り替えます。", + "kb.logitechOnboardAnimations": "保存済みの照明", + "kb.logitechOnboardAnimationHint": "キーボードに効果を保存し、プロファイルで選ぶかショートカットで再生します。", + "kb.logitechOnboardAnimationSlot": "効果スロット", + "kb.logitechOnboardAnimationName": "効果名", + "kb.logitechOnboardAnimationShortcut": "明るさ + {n}", + "kb.logitechOnboardFixedKeys": "キーごとの色", + "kb.logitechOnboardPaint": "描画色", + "kb.logitechOnboardAnimationReplace": "保存済みの効果を置換", "ov.battery": "バッテリー", "ov.firmware": "ファームウェア", "ov.fwSingle": "マウスが報告するファームウェア", @@ -1658,6 +1690,51 @@ export const ja: Record = { "kb.readingTrigger": "キーごとのトリガーを読み取り中…", "kb.applying": "適用中…", "kb.readFailed": "キーボードを読み取れませんでした。", + "kb.logitechPresets": "プリセットカラー", + "kb.logitechLogo": "ロゴ", + "kb.logitechIdleBrightness": "待機時の明るさ(%)", + "kb.logitechIdleAfter": "待機エフェクト開始まで(秒)", + "kb.logitechStartup": "起動時のエフェクト", + "kb.logitechPrimaryColor": "1 色目", + "kb.logitechSecondaryColor": "2 色目", + "kb.logitechMoreControls": "その他の照明設定", + "kb.logitechLightingUnavailable": "照明設定を読み取れませんでした。キーボードからもう一度読み取ってください。", + "kb.logitechZoneEditor": "キーごとの照明", + "kb.logitechOtherZones": "ファームウェアの追加 LED", + "kb.logitechFirmwareLedsHint": "TKL にテンキーはありません。ファームウェアは、対応する物理キーがない LED の位置を報告することもあります。", + "kb.logitechNumpad": "テンキー {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "レインボーウェーブ", + "kb.logitechColorCycle": "カラーサイクル", + "kb.logitechKeyRipple": "キーを押すと波紋", + "kb.logitechEffectPeriod": "速度 · 周期 (ms)", + "kb.logitechWaveDirection": "ウェーブの方向", + "kb.logitechWaveRight": "左から右", + "kb.logitechWaveCenterOut": "中央から外へ", + "kb.logitechWaveCenterIn": "外から中央へ", + "kb.logitechWaveDown": "上から下", + "kb.logitechAurora": "2 色のオーロラグラデーション", + "kb.logitechTrailStart": "キートレイルを開始", + "kb.logitechTrailDuration": "軌跡の長さ (ms)", + "kb.logitechTrailCapture": "ここでキーを押す", + "kb.logitechTrailMode": "キートレイル", + "kb.logitechTrailBase": "基本色", + "kb.logitechTrailColor": "押下時の色", + "kb.logitechTrailHint": "各キーは基本色に戻ります。テスト欄にフォーカスを合わせてください。", + "kb.logitechCircularRainbow": "回転する虹", + "kb.logitechCircularHint": "アニメーションを続けるには OpenMouse を開いたままにしてください。", + "kb.logitechZoneNumber": "ゾーン {n}", + "kb.logitechClusterEffects": "ゾーンごとの効果", + "kb.logitechTargetZone": "照明ゾーン", + "kb.logitechAllZones": "すべてのゾーン", + "kb.logitechEffectWhen": "効果を適用する状態", + "kb.logitechEffectActive": "使用中", + "kb.logitechInactivity": "待機中の照明", + "kb.logitechDimAfter": "操作がないときに暗くするまで(秒)", + "kb.logitechLightsOffAfter": "無操作時に消灯するまで(秒)", + "kb.logitechNever": "なし", + "kb.logitechTimerHint": "タイマーを無効にするには空欄にします。", + "kb.logitechPerformanceReadFailed": "一部のパフォーマンス設定を読み取れませんでした。キーボードから再取得して、もう一度お試しください。", "kb.connFailed": "キーボードの接続に失敗しました", "kb.connectedTo": "{name} に接続しました", "kb.identityFirmware": "ファームウェア", diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index ea7497c7..16f16025 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -155,6 +155,38 @@ export const ko: Record = { "tab.profiles": "프로필", "tab.advanced": "고급", "tab.lighting": "조명", + "tab.gameMode": "게임 모드", + "kb.logitechGameModeHint": "추가로 차단할 키를 선택하세요. 키보드의 게임 모드 버튼으로 모드를 켜거나 끌 수 있습니다.", + "kb.logitechGameModeReplace": "적용하면 키보드의 사용자 지정 목록이 교체됩니다. OpenMouse는 이 브라우저에서 마지막으로 선택한 키를 표시합니다.", + "kb.logitechGameModeFixed": "기본 차단", + "kb.logitechGameModeClear": "선택 지우기", + "kb.logitechGameModeMenu": "메뉴", + "kb.logitechOnboardTitle": "온보드 메모리", + "kb.logitechOnboardHint": "온보드 모드에서 Fn + F2, Fn + F3 또는 Fn + F4로 프로필을 전환하세요.", + "kb.logitechOnboardActiveSlot": "활성 슬롯 {n}", + "kb.logitechOnboardOff": "온보드 모드 꺼짐", + "kb.logitechOnboardName": "프로필 이름", + "kb.logitechOnboardLighting": "키 조명", + "kb.logitechOnboardKeep": "저장된 효과 유지", + "kb.logitechOnboardGameMode": "OpenMouse의 마지막 게임 모드 선택 복사", + "kb.logitechOnboardTimers": "조명은 어두워지는 시점과 같거나 그 이후에 꺼져야 합니다.", + "kb.logitechOnboardActivate": "슬롯 활성화", + "kb.logitechOnboardLeave": "온보드 모드 종료", + "kb.logitechOnboardExtraLighting": "로고 및 절전 조명", + "kb.logitechOnboardIdleKeys": "절전 중 키", + "kb.logitechOnboardIdleLogo": "절전 중 로고", + "kb.logitechOnboardSourceKey": "다시 지정할 키", + "kb.logitechOnboardTargetKey": "출력 키", + "kb.logitechOnboardOriginalKey": "원래 키", + "kb.logitechOnboardAssignmentHint": "기본 레이어에 키 또는 단축키를 저장합니다. Fn + F1로 키 할당을 전환합니다.", + "kb.logitechOnboardAnimations": "저장된 조명", + "kb.logitechOnboardAnimationHint": "키보드에 효과를 저장한 뒤 프로필에서 선택하거나 단축키로 재생하세요.", + "kb.logitechOnboardAnimationSlot": "조명 슬롯", + "kb.logitechOnboardAnimationName": "효과 이름", + "kb.logitechOnboardAnimationShortcut": "밝기 + {n}", + "kb.logitechOnboardFixedKeys": "키별 색상", + "kb.logitechOnboardPaint": "칠할 색상", + "kb.logitechOnboardAnimationReplace": "저장된 효과 교체", "ov.battery": "배터리", "ov.firmware": "펌웨어", "ov.fwSingle": "마우스가 보고한 펌웨어", @@ -1658,6 +1690,51 @@ export const ko: Record = { "kb.readingTrigger": "키별 트리거 읽는 중…", "kb.applying": "적용 중…", "kb.readFailed": "키보드를 읽을 수 없습니다.", + "kb.logitechPresets": "색상 프리셋", + "kb.logitechLogo": "로고", + "kb.logitechIdleBrightness": "대기 밝기(%)", + "kb.logitechIdleAfter": "대기 효과 시작까지(초)", + "kb.logitechStartup": "시작 효과", + "kb.logitechPrimaryColor": "첫 번째 색상", + "kb.logitechSecondaryColor": "두 번째 색상", + "kb.logitechMoreControls": "조명 설정 더 보기", + "kb.logitechLightingUnavailable": "조명 설정을 읽지 못했습니다. 키보드에서 다시 읽어 보세요.", + "kb.logitechZoneEditor": "키별 조명", + "kb.logitechOtherZones": "추가 펌웨어 LED", + "kb.logitechFirmwareLedsHint": "TKL에는 숫자 패드가 없습니다. 펌웨어가 실제 키에 대응하지 않는 LED 위치를 보고할 수도 있습니다.", + "kb.logitechNumpad": "숫자 패드 {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "무지개 물결", + "kb.logitechColorCycle": "색상 순환", + "kb.logitechKeyRipple": "키 입력 파동", + "kb.logitechEffectPeriod": "속도 · 주기 (ms)", + "kb.logitechWaveDirection": "물결 방향", + "kb.logitechWaveRight": "왼쪽에서 오른쪽으로", + "kb.logitechWaveCenterOut": "가운데에서 바깥쪽으로", + "kb.logitechWaveCenterIn": "가운데 쪽으로", + "kb.logitechWaveDown": "위에서 아래로", + "kb.logitechAurora": "두 색상 오로라 그라데이션", + "kb.logitechTrailStart": "키 잔상 시작", + "kb.logitechTrailDuration": "잔상 지속 시간 (ms)", + "kb.logitechTrailCapture": "여기에 입력", + "kb.logitechTrailMode": "키 잔상", + "kb.logitechTrailBase": "기본 색상", + "kb.logitechTrailColor": "입력 시 색상", + "kb.logitechTrailHint": "각 키는 기본 색상으로 돌아갑니다. 테스트 필드에 초점을 유지하세요.", + "kb.logitechCircularRainbow": "회전 무지개", + "kb.logitechCircularHint": "애니메이션을 계속하려면 OpenMouse를 열어 두세요.", + "kb.logitechZoneNumber": "영역 {n}", + "kb.logitechClusterEffects": "영역별 효과", + "kb.logitechTargetZone": "조명 영역", + "kb.logitechAllZones": "모든 영역", + "kb.logitechEffectWhen": "효과 적용 상태", + "kb.logitechEffectActive": "사용 중", + "kb.logitechInactivity": "대기 상태 조명", + "kb.logitechDimAfter": "입력이 없을 때 밝기를 낮추기까지(초)", + "kb.logitechLightsOffAfter": "입력이 없을 때 조명을 끄기까지(초)", + "kb.logitechNever": "사용 안 함", + "kb.logitechTimerHint": "타이머를 끄려면 값을 비워 두세요.", + "kb.logitechPerformanceReadFailed": "일부 성능 설정을 읽지 못했습니다. 키보드에서 새로 고쳐 다시 시도하세요.", "kb.connFailed": "키보드 연결 실패", "kb.connectedTo": "{name}에 연결됨", "kb.identityFirmware": "펌웨어", diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts index b7bb2a2f..696cc859 100644 --- a/src/i18n/locales/pt.ts +++ b/src/i18n/locales/pt.ts @@ -155,6 +155,38 @@ export const pt: Record = { "tab.profiles": "Perfis", "tab.advanced": "Avançado", "tab.lighting": "Iluminação", + "tab.gameMode": "Modo de jogo", + "kb.logitechGameModeHint": "Selecione as teclas adicionais a bloquear. Use o botão do teclado para ativar ou desativar o modo.", + "kb.logitechGameModeReplace": "Aplicar substitui a lista personalizada do teclado. O OpenMouse mostra a última seleção neste navegador.", + "kb.logitechGameModeFixed": "Bloqueada de fábrica", + "kb.logitechGameModeClear": "Limpar seleção", + "kb.logitechGameModeMenu": "Menu", + "kb.logitechOnboardTitle": "Memória integrada", + "kb.logitechOnboardHint": "No modo de memória integrada, use Fn + F2, Fn + F3 ou Fn + F4 para mudar de perfil.", + "kb.logitechOnboardActiveSlot": "Ranhura ativa {n}", + "kb.logitechOnboardOff": "Modo de memória integrada desativado", + "kb.logitechOnboardName": "Nome do perfil", + "kb.logitechOnboardLighting": "Iluminação das teclas", + "kb.logitechOnboardKeep": "Manter o efeito guardado", + "kb.logitechOnboardGameMode": "Copiar a última seleção do modo de jogo do OpenMouse", + "kb.logitechOnboardTimers": "As luzes devem apagar-se ao escurecer ou depois.", + "kb.logitechOnboardActivate": "Ativar ranhura", + "kb.logitechOnboardLeave": "Sair do modo de memória integrada", + "kb.logitechOnboardExtraLighting": "Logótipo e luz em repouso", + "kb.logitechOnboardIdleKeys": "Teclas em repouso", + "kb.logitechOnboardIdleLogo": "Logótipo em repouso", + "kb.logitechOnboardSourceKey": "Tecla a reatribuir", + "kb.logitechOnboardTargetKey": "Tecla de saída", + "kb.logitechOnboardOriginalKey": "Tecla original", + "kb.logitechOnboardAssignmentHint": "Guarde uma tecla ou atalho na camada base. Fn + F1 alterna as atribuições.", + "kb.logitechOnboardAnimations": "Iluminação guardada", + "kb.logitechOnboardAnimationHint": "Guarde um efeito no teclado e escolha-o num perfil ou use o respetivo atalho.", + "kb.logitechOnboardAnimationSlot": "Ranhura de iluminação", + "kb.logitechOnboardAnimationName": "Nome do efeito", + "kb.logitechOnboardAnimationShortcut": "Brilho + {n}", + "kb.logitechOnboardFixedKeys": "Cores por tecla", + "kb.logitechOnboardPaint": "Cor para pintar", + "kb.logitechOnboardAnimationReplace": "Substituir o efeito guardado", "ov.battery": "BATERIA", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Firmware informado pelo mouse", @@ -1658,6 +1690,51 @@ export const pt: Record = { "kb.readingTrigger": "Lendo gatilhos por tecla…", "kb.applying": "Aplicando…", "kb.readFailed": "Não foi possível ler o teclado.", + "kb.logitechPresets": "Cores predefinidas", + "kb.logitechLogo": "Logotipo", + "kb.logitechIdleBrightness": "Brilho em repouso (%)", + "kb.logitechIdleAfter": "Iniciar o efeito em repouso após (segundos)", + "kb.logitechStartup": "Efeito de inicialização", + "kb.logitechPrimaryColor": "Primeira cor", + "kb.logitechSecondaryColor": "Segunda cor", + "kb.logitechMoreControls": "Mais controles de iluminação", + "kb.logitechLightingUnavailable": "Não foi possível ler os ajustes de iluminação. Leia o teclado novamente para tentar de novo.", + "kb.logitechZoneEditor": "Iluminação por tecla", + "kb.logitechOtherZones": "LEDs adicionais do firmware", + "kb.logitechFirmwareLedsHint": "O TKL não tem teclado numérico. O firmware também pode indicar posições de LED sem uma tecla física correspondente.", + "kb.logitechNumpad": "Teclado numérico {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Onda arco-íris", + "kb.logitechColorCycle": "Ciclo de cores", + "kb.logitechKeyRipple": "Ondulação ao premir", + "kb.logitechEffectPeriod": "Velocidade · período (ms)", + "kb.logitechWaveDirection": "Direção da onda", + "kb.logitechWaveRight": "Da esquerda para a direita", + "kb.logitechWaveCenterOut": "Do centro para fora", + "kb.logitechWaveCenterIn": "Em direção ao centro", + "kb.logitechWaveDown": "De cima para baixo", + "kb.logitechAurora": "Degradê Aurora bicolor", + "kb.logitechTrailStart": "Ativar rasto", + "kb.logitechTrailDuration": "Duração do rasto (ms)", + "kb.logitechTrailCapture": "Carregue aqui nas teclas", + "kb.logitechTrailMode": "Rasto de teclas", + "kb.logitechTrailBase": "Cor de base", + "kb.logitechTrailColor": "Cor ao premir", + "kb.logitechTrailHint": "Cada tecla volta à cor de base. Mantém o foco no campo de teste.", + "kb.logitechCircularRainbow": "Arco-íris circular", + "kb.logitechCircularHint": "Mantém o OpenMouse aberto para continuar a animação.", + "kb.logitechZoneNumber": "Zona {n}", + "kb.logitechClusterEffects": "Efeitos por zona", + "kb.logitechTargetZone": "Zona de iluminação", + "kb.logitechAllZones": "Todas as zonas", + "kb.logitechEffectWhen": "Aplicar efeito durante", + "kb.logitechEffectActive": "Utilização ativa", + "kb.logitechInactivity": "Iluminação em repouso", + "kb.logitechDimAfter": "Reduzir após inatividade (segundos)", + "kb.logitechLightsOffAfter": "Apagar as luzes por inatividade (segundos)", + "kb.logitechNever": "Nunca", + "kb.logitechTimerHint": "Deixe um temporizador em branco para o desativar.", + "kb.logitechPerformanceReadFailed": "Não foi possível ler algumas definições de desempenho. Atualize os dados do teclado para tentar novamente.", "kb.connFailed": "Falha ao conectar o teclado", "kb.connectedTo": "Conectado a {name}", "kb.identityFirmware": "Firmware", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 0066bc4a..9a2a1acf 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -155,6 +155,38 @@ export const ru: Record = { "tab.profiles": "Профили", "tab.advanced": "Дополнительно", "tab.lighting": "Подсветка", + "tab.gameMode": "Игровой режим", + "kb.logitechGameModeHint": "Выберите дополнительные клавиши для блокировки. Включайте и выключайте режим кнопкой на клавиатуре.", + "kb.logitechGameModeReplace": "Применение заменяет список дополнительных блокировок клавиатуры. OpenMouse показывает последний выбор в этом браузере.", + "kb.logitechGameModeFixed": "Заблокирована по умолчанию", + "kb.logitechGameModeClear": "Очистить выбор", + "kb.logitechGameModeMenu": "Меню", + "kb.logitechOnboardTitle": "Встроенная память", + "kb.logitechOnboardHint": "В режиме встроенной памяти переключайте профили сочетаниями Fn + F2, Fn + F3 и Fn + F4.", + "kb.logitechOnboardActiveSlot": "Активный слот {n}", + "kb.logitechOnboardOff": "Режим встроенной памяти выключен", + "kb.logitechOnboardName": "Имя профиля", + "kb.logitechOnboardLighting": "Подсветка клавиш", + "kb.logitechOnboardKeep": "Сохранить текущий эффект", + "kb.logitechOnboardGameMode": "Скопировать последний выбор игрового режима из OpenMouse", + "kb.logitechOnboardTimers": "Подсветка должна отключаться одновременно с затемнением или позже.", + "kb.logitechOnboardActivate": "Активировать слот", + "kb.logitechOnboardLeave": "Выйти из режима встроенной памяти", + "kb.logitechOnboardExtraLighting": "Логотип и подсветка в режиме сна", + "kb.logitechOnboardIdleKeys": "Клавиши в режиме сна", + "kb.logitechOnboardIdleLogo": "Логотип в режиме сна", + "kb.logitechOnboardSourceKey": "Переназначаемая клавиша", + "kb.logitechOnboardTargetKey": "Выходная клавиша", + "kb.logitechOnboardOriginalKey": "Исходная клавиша", + "kb.logitechOnboardAssignmentHint": "Сохраните клавишу или сочетание в базовом слое. Fn + F1 переключает назначения.", + "kb.logitechOnboardAnimations": "Сохранённая подсветка", + "kb.logitechOnboardAnimationHint": "Сохраните эффект в клавиатуре и выберите его в профиле или используйте сочетание клавиш.", + "kb.logitechOnboardAnimationSlot": "Слот подсветки", + "kb.logitechOnboardAnimationName": "Название эффекта", + "kb.logitechOnboardAnimationShortcut": "Яркость + {n}", + "kb.logitechOnboardFixedKeys": "Цвета отдельных клавиш", + "kb.logitechOnboardPaint": "Цвет окраски", + "kb.logitechOnboardAnimationReplace": "Заменить сохранённый эффект", "ov.battery": "БАТАРЕЯ", "ov.firmware": "ПРОШИВКА", "ov.fwSingle": "Прошивка по данным мыши", @@ -1658,6 +1690,51 @@ export const ru: Record = { "kb.readingTrigger": "Чтение срабатываний по клавишам…", "kb.applying": "Применение…", "kb.readFailed": "Не удалось прочитать клавиатуру.", + "kb.logitechPresets": "Предустановленные цвета", + "kb.logitechLogo": "Логотип", + "kb.logitechIdleBrightness": "Яркость в простое (%)", + "kb.logitechIdleAfter": "Включать эффект простоя через (секунды)", + "kb.logitechStartup": "Эффект при включении", + "kb.logitechPrimaryColor": "Первый цвет", + "kb.logitechSecondaryColor": "Второй цвет", + "kb.logitechMoreControls": "Другие настройки подсветки", + "kb.logitechLightingUnavailable": "Не удалось прочитать настройки подсветки. Повторите считывание с клавиатуры.", + "kb.logitechZoneEditor": "Подсветка отдельных клавиш", + "kb.logitechOtherZones": "Дополнительные светодиоды прошивки", + "kb.logitechFirmwareLedsHint": "У TKL нет цифрового блока. Прошивка также может сообщать о позициях светодиодов без соответствующей физической клавиши.", + "kb.logitechNumpad": "Цифровой блок {key}", + "kb.logitechLedId": "Светодиод {id}", + "kb.logitechRainbowWave": "Радужная волна", + "kb.logitechColorCycle": "Смена цветов", + "kb.logitechKeyRipple": "Волны при нажатии", + "kb.logitechEffectPeriod": "Скорость · период (мс)", + "kb.logitechWaveDirection": "Направление волны", + "kb.logitechWaveRight": "Слева направо", + "kb.logitechWaveCenterOut": "От центра", + "kb.logitechWaveCenterIn": "К центру", + "kb.logitechWaveDown": "Сверху вниз", + "kb.logitechAurora": "Двухцветный градиент «Аврора»", + "kb.logitechTrailStart": "Включить след клавиш", + "kb.logitechTrailDuration": "Длительность следа (мс)", + "kb.logitechTrailCapture": "Нажимайте клавиши здесь", + "kb.logitechTrailMode": "След клавиш", + "kb.logitechTrailBase": "Основной цвет", + "kb.logitechTrailColor": "Цвет при нажатии", + "kb.logitechTrailHint": "Каждая клавиша возвращается к основному цвету. Оставьте фокус в поле теста.", + "kb.logitechCircularRainbow": "Круговая радуга", + "kb.logitechCircularHint": "Оставьте OpenMouse открытым, чтобы анимация продолжалась.", + "kb.logitechZoneNumber": "Зона {n}", + "kb.logitechClusterEffects": "Эффекты по зонам", + "kb.logitechTargetZone": "Зона подсветки", + "kb.logitechAllZones": "Все зоны", + "kb.logitechEffectWhen": "Применять эффект при", + "kb.logitechEffectActive": "Активном использовании", + "kb.logitechInactivity": "Подсветка в простое", + "kb.logitechDimAfter": "Приглушить после простоя (секунды)", + "kb.logitechLightsOffAfter": "Выключить подсветку при бездействии (секунды)", + "kb.logitechNever": "Никогда", + "kb.logitechTimerHint": "Оставьте поле таймера пустым, чтобы отключить его.", + "kb.logitechPerformanceReadFailed": "Не удалось прочитать некоторые настройки производительности. Обновите данные с клавиатуры и повторите попытку.", "kb.connFailed": "Не удалось подключить клавиатуру", "kb.connectedTo": "Подключено к {name}", "kb.identityFirmware": "Прошивка", diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts index 7f58a957..50ccb536 100644 --- a/src/i18n/locales/tr.ts +++ b/src/i18n/locales/tr.ts @@ -155,6 +155,38 @@ export const tr: Record = { "tab.profiles": "Profiller", "tab.advanced": "Gelişmiş", "tab.lighting": "Aydınlatma", + "tab.gameMode": "Oyun modu", + "kb.logitechGameModeHint": "Engellenecek ek tuşları seçin. Modu açmak veya kapatmak için klavyedeki oyun modu düğmesini kullanın.", + "kb.logitechGameModeReplace": "Uygulamak, klavyenin özel tuş listesini değiştirir. OpenMouse bu tarayıcıdaki son seçimi gösterir.", + "kb.logitechGameModeFixed": "Varsayılan olarak engelli", + "kb.logitechGameModeClear": "Seçimi temizle", + "kb.logitechGameModeMenu": "Menü", + "kb.logitechOnboardTitle": "Dahili bellek", + "kb.logitechOnboardHint": "Dahili bellek modunda Fn + F2, Fn + F3 veya Fn + F4 ile profil değiştirin.", + "kb.logitechOnboardActiveSlot": "Etkin yuva {n}", + "kb.logitechOnboardOff": "Dahili bellek modu kapalı", + "kb.logitechOnboardName": "Profil adı", + "kb.logitechOnboardLighting": "Tuş aydınlatması", + "kb.logitechOnboardKeep": "Kayıtlı efekti koru", + "kb.logitechOnboardGameMode": "OpenMouse’un son oyun modu seçimini kopyala", + "kb.logitechOnboardTimers": "Işıklar kısılma anında veya sonrasında kapanmalıdır.", + "kb.logitechOnboardActivate": "Yuvayı etkinleştir", + "kb.logitechOnboardLeave": "Dahili bellek modundan çık", + "kb.logitechOnboardExtraLighting": "Logo ve uyku aydınlatması", + "kb.logitechOnboardIdleKeys": "Uykuda tuşlar", + "kb.logitechOnboardIdleLogo": "Uykuda logo", + "kb.logitechOnboardSourceKey": "Yeniden atanacak tuş", + "kb.logitechOnboardTargetKey": "Çıkış tuşu", + "kb.logitechOnboardOriginalKey": "Özgün tuş", + "kb.logitechOnboardAssignmentHint": "Temel katmana bir tuş veya kısayol kaydet. Fn + F1 tuş atamalarını değiştirir.", + "kb.logitechOnboardAnimations": "Kayıtlı aydınlatma", + "kb.logitechOnboardAnimationHint": "Efekti klavyeye kaydet ve bir profilden seç veya kısayolunu kullan.", + "kb.logitechOnboardAnimationSlot": "Aydınlatma yuvası", + "kb.logitechOnboardAnimationName": "Efekt adı", + "kb.logitechOnboardAnimationShortcut": "Parlaklık + {n}", + "kb.logitechOnboardFixedKeys": "Tuşa özel renkler", + "kb.logitechOnboardPaint": "Boyama rengi", + "kb.logitechOnboardAnimationReplace": "Kayıtlı efekti değiştir", "ov.battery": "PİL", "ov.firmware": "AYGIT YAZILIMI", "ov.fwSingle": "Farenin bildirdiği aygıt yazılımı", @@ -1635,6 +1667,51 @@ export const tr: Record = { "kb.readingTrigger": "Tuş tetikleme ayarları okunuyor…", "kb.applying": "Uygulanıyor…", "kb.readFailed": "Klavye okunamadı.", + "kb.logitechPresets": "Hazır renkler", + "kb.logitechLogo": "Logo", + "kb.logitechIdleBrightness": "Boştaki parlaklık (%)", + "kb.logitechIdleAfter": "Boşta efektini başlatma süresi (saniye)", + "kb.logitechStartup": "Başlangıç efekti", + "kb.logitechPrimaryColor": "İlk renk", + "kb.logitechSecondaryColor": "İkinci renk", + "kb.logitechMoreControls": "Diğer aydınlatma ayarları", + "kb.logitechLightingUnavailable": "Aydınlatma ayarları okunamadı. Yeniden denemek için klavyeden okuyun.", + "kb.logitechZoneEditor": "Tuş başına aydınlatma", + "kb.logitechOtherZones": "Ek ürün yazılımı LED’leri", + "kb.logitechFirmwareLedsHint": "TKL’de sayısal tuş takımı yoktur. Ürün yazılımı, fiziksel bir tuşa karşılık gelmeyen LED konumları da bildirebilir.", + "kb.logitechNumpad": "Sayısal tuş {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Gökkuşağı dalgası", + "kb.logitechColorCycle": "Renk döngüsü", + "kb.logitechKeyRipple": "Tuşa basınca dalga", + "kb.logitechEffectPeriod": "Hız · periyot (ms)", + "kb.logitechWaveDirection": "Dalga yönü", + "kb.logitechWaveRight": "Soldan sağa", + "kb.logitechWaveCenterOut": "Merkezden dışarı", + "kb.logitechWaveCenterIn": "Merkeze doğru", + "kb.logitechWaveDown": "Yukarıdan aşağıya", + "kb.logitechAurora": "İki renkli Aurora geçişi", + "kb.logitechTrailStart": "Tuş izini başlat", + "kb.logitechTrailDuration": "İz süresi (ms)", + "kb.logitechTrailCapture": "Buraya yazın", + "kb.logitechTrailMode": "Tuş izi", + "kb.logitechTrailBase": "Temel renk", + "kb.logitechTrailColor": "Basma rengi", + "kb.logitechTrailHint": "Her tuş temel rengine döner. Odağı test alanında tutun.", + "kb.logitechCircularRainbow": "Dairesel gökkuşağı", + "kb.logitechCircularHint": "Animasyonun sürmesi için OpenMouse’u açık tutun.", + "kb.logitechZoneNumber": "Bölge {n}", + "kb.logitechClusterEffects": "Bölgeye göre efektler", + "kb.logitechTargetZone": "Aydınlatma bölgesi", + "kb.logitechAllZones": "Tüm bölgeler", + "kb.logitechEffectWhen": "Efektin uygulanacağı durum", + "kb.logitechEffectActive": "Etkin kullanım", + "kb.logitechInactivity": "Boşta aydınlatma", + "kb.logitechDimAfter": "Hareketsizlik sonrası kısma (saniye)", + "kb.logitechLightsOffAfter": "Boştayken ışıkları kapatma (saniye)", + "kb.logitechNever": "Asla", + "kb.logitechTimerHint": "Zamanlayıcıyı kapatmak için alanı boş bırakın.", + "kb.logitechPerformanceReadFailed": "Bazı performans ayarları okunamadı. Tekrar denemek için klavyeden yenileyin.", "kb.connFailed": "Klavye bağlantısı başarısız", "kb.connectedTo": "{name} bağlandı", "kb.identityFirmware": "Aygıt yazılımı", diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts index f1993357..c53d251e 100644 --- a/src/i18n/locales/vi.ts +++ b/src/i18n/locales/vi.ts @@ -155,6 +155,38 @@ export const vi: Record = { "tab.profiles": "Profiles", "tab.advanced": "Nâng cao", "tab.lighting": "Đèn", + "tab.gameMode": "Chế độ chơi game", + "kb.logitechGameModeHint": "Chọn các phím bổ sung cần chặn. Dùng nút trên bàn phím để bật hoặc tắt chế độ.", + "kb.logitechGameModeReplace": "Áp dụng sẽ thay thế danh sách tùy chỉnh của bàn phím. OpenMouse hiển thị lựa chọn gần nhất trên trình duyệt này.", + "kb.logitechGameModeFixed": "Bị chặn theo mặc định", + "kb.logitechGameModeClear": "Xóa lựa chọn", + "kb.logitechGameModeMenu": "Menu", + "kb.logitechOnboardTitle": "Bộ nhớ tích hợp", + "kb.logitechOnboardHint": "Ở chế độ bộ nhớ tích hợp, dùng Fn + F2, Fn + F3 hoặc Fn + F4 để chuyển hồ sơ.", + "kb.logitechOnboardActiveSlot": "Khe đang dùng {n}", + "kb.logitechOnboardOff": "Chế độ bộ nhớ tích hợp đang tắt", + "kb.logitechOnboardName": "Tên hồ sơ", + "kb.logitechOnboardLighting": "Đèn phím", + "kb.logitechOnboardKeep": "Giữ hiệu ứng đã lưu", + "kb.logitechOnboardGameMode": "Sao chép lựa chọn chế độ chơi game gần nhất của OpenMouse", + "kb.logitechOnboardTimers": "Đèn chỉ được tắt từ lúc giảm sáng trở đi.", + "kb.logitechOnboardActivate": "Kích hoạt khe", + "kb.logitechOnboardLeave": "Thoát chế độ bộ nhớ tích hợp", + "kb.logitechOnboardExtraLighting": "Logo và đèn khi ngủ", + "kb.logitechOnboardIdleKeys": "Đèn phím khi ngủ", + "kb.logitechOnboardIdleLogo": "Logo khi ngủ", + "kb.logitechOnboardSourceKey": "Phím cần gán lại", + "kb.logitechOnboardTargetKey": "Phím đầu ra", + "kb.logitechOnboardOriginalKey": "Phím gốc", + "kb.logitechOnboardAssignmentHint": "Lưu phím hoặc phím tắt ở lớp cơ bản. Fn + F1 bật hoặc tắt các gán phím.", + "kb.logitechOnboardAnimations": "Đèn đã lưu", + "kb.logitechOnboardAnimationHint": "Lưu hiệu ứng vào bàn phím rồi chọn trong hồ sơ hoặc dùng phím tắt.", + "kb.logitechOnboardAnimationSlot": "Khe hiệu ứng", + "kb.logitechOnboardAnimationName": "Tên hiệu ứng", + "kb.logitechOnboardAnimationShortcut": "Độ sáng + {n}", + "kb.logitechOnboardFixedKeys": "Màu theo từng phím", + "kb.logitechOnboardPaint": "Màu tô", + "kb.logitechOnboardAnimationReplace": "Thay thế hiệu ứng đã lưu", "ov.battery": "PIN", "ov.firmware": "FIRMWARE", "ov.fwSingle": "Firmware do chuột báo cáo", @@ -1663,6 +1695,51 @@ export const vi: Record = { "kb.readingTrigger": "Đang đọc điểm kích hoạt từng phím…", "kb.applying": "Đang áp dụng…", "kb.readFailed": "Không thể đọc bàn phím.", + "kb.logitechPresets": "Màu cài sẵn", + "kb.logitechLogo": "Biểu trưng", + "kb.logitechIdleBrightness": "Độ sáng khi không hoạt động (%)", + "kb.logitechIdleAfter": "Bắt đầu hiệu ứng chờ sau (giây)", + "kb.logitechStartup": "Hiệu ứng khởi động", + "kb.logitechPrimaryColor": "Màu thứ nhất", + "kb.logitechSecondaryColor": "Màu thứ hai", + "kb.logitechMoreControls": "Thêm điều khiển đèn", + "kb.logitechLightingUnavailable": "Không đọc được thiết lập đèn. Hãy đọc lại từ bàn phím để thử lại.", + "kb.logitechZoneEditor": "Đèn theo từng phím", + "kb.logitechOtherZones": "Đèn LED bổ sung do firmware báo", + "kb.logitechFirmwareLedsHint": "Bàn phím TKL không có cụm phím số. Firmware cũng có thể báo các vị trí LED không có phím vật lý tương ứng.", + "kb.logitechNumpad": "Cụm phím số {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "Sóng cầu vồng", + "kb.logitechColorCycle": "Chu kỳ màu", + "kb.logitechKeyRipple": "Gợn sóng khi nhấn phím", + "kb.logitechEffectPeriod": "Tốc độ · chu kỳ (ms)", + "kb.logitechWaveDirection": "Hướng sóng", + "kb.logitechWaveRight": "Từ trái sang phải", + "kb.logitechWaveCenterOut": "Từ tâm ra ngoài", + "kb.logitechWaveCenterIn": "Hướng vào tâm", + "kb.logitechWaveDown": "Từ trên xuống dưới", + "kb.logitechAurora": "Dải màu cực quang hai màu", + "kb.logitechTrailStart": "Bật vệt phím", + "kb.logitechTrailDuration": "Thời gian lưu vệt (ms)", + "kb.logitechTrailCapture": "Gõ phím ở đây", + "kb.logitechTrailMode": "Vệt phím", + "kb.logitechTrailBase": "Màu nền", + "kb.logitechTrailColor": "Màu khi nhấn", + "kb.logitechTrailHint": "Mỗi phím trở về màu nền. Hãy giữ tiêu điểm ở ô thử nghiệm.", + "kb.logitechCircularRainbow": "Cầu vồng xoay", + "kb.logitechCircularHint": "Giữ OpenMouse mở để hiệu ứng tiếp tục.", + "kb.logitechZoneNumber": "Vùng {n}", + "kb.logitechClusterEffects": "Hiệu ứng theo vùng", + "kb.logitechTargetZone": "Vùng đèn", + "kb.logitechAllZones": "Mọi vùng", + "kb.logitechEffectWhen": "Áp dụng hiệu ứng khi", + "kb.logitechEffectActive": "Đang sử dụng", + "kb.logitechInactivity": "Đèn khi không hoạt động", + "kb.logitechDimAfter": "Giảm sáng sau thời gian chờ (giây)", + "kb.logitechLightsOffAfter": "Tắt đèn khi không hoạt động (giây)", + "kb.logitechNever": "Không bao giờ", + "kb.logitechTimerHint": "Để trống bộ hẹn giờ để tắt tính năng.", + "kb.logitechPerformanceReadFailed": "Không thể đọc một số cài đặt hiệu suất. Hãy làm mới dữ liệu từ bàn phím để thử lại.", "kb.connFailed": "Kết nối bàn phím thất bại", "kb.connectedTo": "Đã kết nối với {name}", "kb.identityFirmware": "Phần sụn", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index bec52b5c..2becad4c 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -155,6 +155,38 @@ export const zh: Record = { "tab.profiles": "配置文件", "tab.advanced": "高级", "tab.lighting": "灯光", + "tab.gameMode": "游戏模式", + "kb.logitechGameModeHint": "选择要额外禁用的按键。使用键盘上的游戏模式按钮开启或关闭此模式。", + "kb.logitechGameModeReplace": "应用后将替换键盘上的自定义禁用列表。OpenMouse 显示此浏览器中上次保存的选择。", + "kb.logitechGameModeFixed": "默认禁用", + "kb.logitechGameModeClear": "清除选择", + "kb.logitechGameModeMenu": "菜单", + "kb.logitechOnboardTitle": "板载内存", + "kb.logitechOnboardHint": "在板载模式下,使用 Fn + F2、Fn + F3 或 Fn + F4 切换配置。", + "kb.logitechOnboardActiveSlot": "活动槽位 {n}", + "kb.logitechOnboardOff": "板载模式已关闭", + "kb.logitechOnboardName": "配置名称", + "kb.logitechOnboardLighting": "按键灯光", + "kb.logitechOnboardKeep": "保留已保存的效果", + "kb.logitechOnboardGameMode": "复制 OpenMouse 上次的游戏模式选项", + "kb.logitechOnboardTimers": "灯光应在变暗时或之后关闭。", + "kb.logitechOnboardActivate": "启用槽位", + "kb.logitechOnboardLeave": "退出板载模式", + "kb.logitechOnboardExtraLighting": "徽标与休眠灯光", + "kb.logitechOnboardIdleKeys": "休眠时的按键灯光", + "kb.logitechOnboardIdleLogo": "休眠时的徽标灯光", + "kb.logitechOnboardSourceKey": "要重映射的按键", + "kb.logitechOnboardTargetKey": "输出按键", + "kb.logitechOnboardOriginalKey": "原始按键", + "kb.logitechOnboardAssignmentHint": "将按键或快捷键保存到基础层。使用 Fn + F1 切换按键自定义。", + "kb.logitechOnboardAnimations": "已保存的灯光", + "kb.logitechOnboardAnimationHint": "将效果保存到键盘,然后在配置中选择或通过快捷键播放。", + "kb.logitechOnboardAnimationSlot": "灯光槽位", + "kb.logitechOnboardAnimationName": "效果名称", + "kb.logitechOnboardAnimationShortcut": "亮度 + {n}", + "kb.logitechOnboardFixedKeys": "单键颜色", + "kb.logitechOnboardPaint": "涂色颜色", + "kb.logitechOnboardAnimationReplace": "替换已保存的效果", "ov.battery": "电池", "ov.firmware": "固件", "ov.fwSingle": "鼠标上报的固件版本", @@ -1658,6 +1690,51 @@ export const zh: Record = { "kb.readingTrigger": "正在读取逐键触发行程…", "kb.applying": "正在应用…", "kb.readFailed": "无法读取键盘。", + "kb.logitechPresets": "预设颜色", + "kb.logitechLogo": "标志", + "kb.logitechIdleBrightness": "待机亮度(%)", + "kb.logitechIdleAfter": "开始待机灯效前的时间(秒)", + "kb.logitechStartup": "启动灯效", + "kb.logitechPrimaryColor": "第一种颜色", + "kb.logitechSecondaryColor": "第二种颜色", + "kb.logitechMoreControls": "更多灯光设置", + "kb.logitechLightingUnavailable": "无法读取灯光设置。请重新读取键盘后再试。", + "kb.logitechZoneEditor": "逐键灯光", + "kb.logitechOtherZones": "固件报告的额外 LED", + "kb.logitechFirmwareLedsHint": "TKL 没有数字小键盘。固件也可能报告没有对应实体按键的 LED 位置。", + "kb.logitechNumpad": "数字小键盘 {key}", + "kb.logitechLedId": "LED {id}", + "kb.logitechRainbowWave": "彩虹波浪", + "kb.logitechColorCycle": "色彩循环", + "kb.logitechKeyRipple": "按键涟漪", + "kb.logitechEffectPeriod": "速度 · 周期(毫秒)", + "kb.logitechWaveDirection": "波浪方向", + "kb.logitechWaveRight": "从左到右", + "kb.logitechWaveCenterOut": "从中心向外", + "kb.logitechWaveCenterIn": "向中心汇聚", + "kb.logitechWaveDown": "从上到下", + "kb.logitechAurora": "双色极光渐变", + "kb.logitechTrailStart": "开启按键余迹", + "kb.logitechTrailDuration": "余迹持续时间(毫秒)", + "kb.logitechTrailCapture": "在这里按键", + "kb.logitechTrailMode": "按键余迹", + "kb.logitechTrailBase": "基础颜色", + "kb.logitechTrailColor": "按键颜色", + "kb.logitechTrailHint": "每个按键都会恢复到基础颜色。请将焦点留在测试框中。", + "kb.logitechCircularRainbow": "环形彩虹", + "kb.logitechCircularHint": "保持 OpenMouse 打开以继续播放动画。", + "kb.logitechZoneNumber": "区域 {n}", + "kb.logitechClusterEffects": "分区效果", + "kb.logitechTargetZone": "灯光区域", + "kb.logitechAllZones": "所有区域", + "kb.logitechEffectWhen": "应用效果的状态", + "kb.logitechEffectActive": "使用中", + "kb.logitechInactivity": "空闲灯光", + "kb.logitechDimAfter": "空闲后调暗(秒)", + "kb.logitechLightsOffAfter": "无操作时关闭灯光(秒)", + "kb.logitechNever": "从不", + "kb.logitechTimerHint": "将计时器留空以停用。", + "kb.logitechPerformanceReadFailed": "无法读取部分性能设置。请从键盘刷新数据后重试。", "kb.connFailed": "键盘连接失败", "kb.connectedTo": "已连接到 {name}", "kb.identityFirmware": "固件", diff --git a/src/shared/device-images.test.ts b/src/shared/device-images.test.ts index a8204165..54ca871a 100644 --- a/src/shared/device-images.test.ts +++ b/src/shared/device-images.test.ts @@ -418,3 +418,8 @@ test("Rival 650 diagram does not replace the generic product artwork", () => { assert.equal(isUnknownDevice(device, "SteelSeries Rival 650 Wireless"), true); } }); + +test("the G915 X TKL has its own contained render, including behind a shared receiver", () => { + assert.equal(deviceImage(undefined, "G915 X LIGHTSPEED TKL", "keyboard"), "/devices/logitech-g915-x-tkl.png"); + assert.notEqual(deviceImage(undefined, "G915 X LIGHTSPEED", "keyboard"), "/devices/logitech-g915-x-tkl.png"); +}); diff --git a/src/shared/device-images.ts b/src/shared/device-images.ts index 06480a5f..c9722cba 100644 --- a/src/shared/device-images.ts +++ b/src/shared/device-images.ts @@ -31,6 +31,7 @@ function resolveDeviceImageFilename(_device: HIDDevice | null | undefined, displ } function computeDeviceImageFilename(displayName: string): string { + if (/\bg915\s*x\b.*\btkl\b/i.test(displayName)) return "logitech-g915-x-tkl.png"; // Lightspeed receivers are shared product IDs, so paired G502 X variants // must use the friendly name read from the mouse itself. if (/g502\s*x\s*plus/i.test(displayName)) return "logitech-g502-x-plus.png"; @@ -242,6 +243,7 @@ const LOCAL_OVERRIDES: Readonly> = { "xiaomi-mi-gaming-mouse.png": "/devices/xiaomi-mi-gaming-mouse.png", "vxe-r1-se.png": "/devices/vxe-r1-se.png", "redragon-m991.png": "/devices/redragon-m991.png", + "logitech-g915-x-tkl.png": "/devices/logitech-g915-x-tkl.png", }; export type DeviceImageKind = "mouse" | "keyboard"; diff --git a/src/styles/areas/advanced.css b/src/styles/areas/advanced.css index 98e6c6cf..23635fe2 100644 --- a/src/styles/areas/advanced.css +++ b/src/styles/areas/advanced.css @@ -457,3 +457,41 @@ aside.testing-note strong { display: none; } .receiver-assignment input { width: 100%; } :is(.receiver-button, .receiver-action-grid button, .receiver-key-grid button, .receiver-categories button)[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); } :is(.receiver-button, .receiver-action-grid button, .receiver-key-grid button, .receiver-categories button):hover:not(:disabled) { border-color: var(--accent-line); color: var(--text-1); } + +.logitech-lighting-deck { display: grid; gap: 8px; } +.logitech-lighting-row, .logitech-lighting-controls { + display: flex; flex-wrap: wrap; gap: 4px; align-items: center; +} +.logitech-lighting-row .keyboard-key { min-inline-size: 32px; min-block-size: 32px; } +.logitech-lighting-row .logitech-spacebar { min-inline-size: 128px; } +.logitech-game-mode-deck { overflow-x: auto; } +.logitech-game-mode-deck .logitech-lighting-row:not(:first-child) { flex-wrap: nowrap; gap: 2px; } +.logitech-game-mode-deck .keyboard-key { min-inline-size: 26px; flex-shrink: 0; } +.logitech-game-mode-deck .logitech-spacebar { min-inline-size: 112px; } +.logitech-game-mode-deck .keyboard-key[aria-pressed="true"]:disabled { opacity: .8; } +.logitech-onboard-panel fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; border: 0; margin: 0; padding: 0; } +.logitech-onboard-panel .setting-heading { justify-content: flex-start; gap: 8px; } + +.logitech-lighting-panel { grid-template-columns: minmax(0, 1fr); } +.logitech-lighting-panel .keyboard-status { min-block-size: 40px; padding-block: 8px; } +.logitech-lighting-panel .setting-heading { justify-content: flex-start; gap: 8px; } +.logitech-lighting-panel .setting-heading svg { inline-size: 16px; block-size: 16px; color: var(--text-3); } +.logitech-lighting-panel details > summary { cursor: pointer; color: var(--text-2); } +.logitech-lighting-panel details[open] > summary { margin-block-end: 8px; } +.logitech-lighting-fields { + display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr)); + align-items: end; gap: 8px; min-inline-size: 0; +} +.logitech-lighting-fields .keyboard-field { display: grid; align-content: space-between; align-self: stretch; gap: 4px; } +.logitech-lighting-fields .keyboard-field > :is(input, select):not([type="checkbox"]) { inline-size: 100%; min-block-size: 32px; } +.logitech-lighting-fields .keyboard-field > input[type="checkbox"] { inline-size: auto; align-self: start; } +.logitech-lighting-fields .om-btn { justify-self: end; } +.logitech-lighting-fields > .setting-note { grid-column: 1 / -1; } +.logitech-lighting-fields + .logitech-palette + .logitech-lighting-fields { + padding-block-start: 12px; border-block-start: 1px solid var(--line-1); +} +.logitech-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; } +.logitech-palette > span { margin-inline-end: 4px; color: var(--text-3); font-size: var(--fs-meta); } +.logitech-palette button > span { + display: block; inline-size: 16px; block-size: 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); +}