MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / decodeModifyOtherKeysPrintable

Function decodeModifyOtherKeysPrintable

packages/pi-tui/src/keys.ts:1384–1396  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

1382}
1383
1384function decodeModifyOtherKeysPrintable(data: string): string | undefined {
1385 const parsed = parseModifyOtherKeysSequence(data);
1386 if (!parsed) return undefined;
1387 const modifier = parsed.modifier & ~LOCK_MASK;
1388 if ((modifier & ~MODIFIERS.shift) !== 0) return undefined;
1389 if (!Number.isFinite(parsed.codepoint) || parsed.codepoint < 32) return undefined;
1390
1391 try {
1392 return String.fromCodePoint(parsed.codepoint);
1393 } catch {
1394 return undefined;
1395 }
1396}
1397
1398export function decodePrintableKey(data: string): string | undefined {
1399 return decodeKittyPrintable(data) ?? decodeModifyOtherKeysPrintable(data);

Callers 1

decodePrintableKeyFunction · 0.85

Calls 1

Tested by

no test coverage detected