Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Member group

OpenKeyInput

Declaring type: Console
Module: System
Assembly: System.Runtime.dll
Source file: Console.rvn

Overloads / Variants

OpenKeyInput

static func OpenKeyInput() -> Result<ConsoleKeyReader, ConsoleKeyError>

Source file: Console.rvn

Acquires key input while preserving terminal signal handling.

Return value

Result<ConsoleKeyReader, ConsoleKeyError>

OpenKeyInput

static func OpenKeyInput(captureInterrupts: bool) -> Result<ConsoleKeyReader, ConsoleKeyError>

Source file: Console.rvn

Acquires synchronous, non-echoing terminal key input before text input starts.

Parameters

Name Type Description
captureInterrupts Boolean When true, signal characters such as Ctrl+C are returned as keys instead of generating terminal signals.

Return value

Result<ConsoleKeyReader, ConsoleKeyError>

An exclusive disposable reader, or Unavailable, Busy or ReadFailed.

Remarks

Defaults to preserving signal handling. Redirected stdin and unsupported hosts return Unavailable. Text input can follow a closed key session, but a text cursor cannot currently be handed back to key mode.