MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / key

Function key

source code/utils/computerUse/executor.ts:457–475  ·  view source on GitHub ↗

* xdotool-style sequence e.g. "ctrl+shift+a" → split on '+' and pass to * keys(). keys() dispatches to DispatchQueue.main — drainRunLoop pumps * CFRunLoop so it resolves. Rust's error-path cleanup (enigo_wrap.rs) * releases modifiers on each invocation, so a mid-loop throw leaves

(keySequence: string, repeat?: number)

Source from the content-addressed store, hash-verified

455 * nothing stuck. 8ms between iterations — 125Hz USB polling cadence.
456 */
457 async key(keySequence: string, repeat?: number): Promise<void> {
458 const input = requireComputerUseInput()
459 const parts = keySequence.split('+').filter(p => p.length > 0)
460 // Bare-only: the CGEventTap checks event.flags.isEmpty so ctrl+escape
461 // etc. pass through without aborting.
462 const isEsc = isBareEscape(parts)
463 const n = repeat ?? 1
464 await drainRunLoop(async () => {
465 for (let i = 0; i < n; i++) {
466 if (i > 0) {
467 await sleep(8)
468 }
469 if (isEsc) {
470 notifyExpectedEscape()
471 }
472 await input.keys(parts)
473 }
474 })
475 },
476
477 async holdKey(keyNames: string[], durationMs: number): Promise<void> {
478 const input = requireComputerUseInput()

Callers

nothing calls this directly

Calls 6

requireComputerUseInputFunction · 0.85
isBareEscapeFunction · 0.85
drainRunLoopFunction · 0.85
sleepFunction · 0.85
notifyExpectedEscapeFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected