MCPcopy
hub / github.com/anomalyco/opencode / win32DisableProcessedInput

Function win32DisableProcessedInput

packages/tui/src/terminal-win32.ts:30–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 * Clear ENABLE_PROCESSED_INPUT on the console stdin handle.
29 */
30export function win32DisableProcessedInput() {
31 if (process.platform !== "win32") return
32 if (!process.stdin.isTTY) return
33 if (!load()) return
34
35 const handle = k32!.symbols.GetStdHandle(STD_INPUT_HANDLE)
36 const buf = new Uint32Array(1)
37 if (k32!.symbols.GetConsoleMode(handle, ptr(buf)) === 0) return
38
39 const mode = buf[0]!
40 if ((mode & ENABLE_PROCESSED_INPUT) === 0) return
41 k32!.symbols.SetConsoleMode(handle, mode & ~ENABLE_PROCESSED_INPUT)
42}
43
44/**
45 * Discard any queued console input (mouse events, key presses, etc.).

Callers 1

app.tsxFile · 0.90

Calls 1

loadFunction · 0.70

Tested by

no test coverage detected