Add hold and special inputs to combos
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s

This commit is contained in:
Shinuwa 2026-08-03 12:53:34 +02:00
parent 9b72f4934c
commit 1a35dcae7b
15 changed files with 575 additions and 26 deletions

View file

@ -362,7 +362,15 @@ export function normalizeCountersData(data) {
function normalizeComboInput(input) {
const kind = COMBO_INPUT_KINDS.has(input?.kind) ? input.kind : "";
const value = String(input?.value || "").trim().slice(0, 24);
return kind && value ? { kind, value } : null;
if (!kind || !value) return null;
const holdMs = Number(input?.holdMs);
const normalizedHoldMs = Number.isFinite(holdMs) && holdMs > 0
? Math.min(99000, Math.round(holdMs / 1000) * 1000)
: 0;
const normalized = { kind, value };
if (input?.hold === true || normalizedHoldMs > 0) normalized.hold = true;
if (normalizedHoldMs > 0) normalized.holdMs = normalizedHoldMs;
return normalized;
}
function normalizeComboSteps(inputs) {