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

API Browser

Method

ReadKey

func ReadKey() -> Result<Optional<ConsoleKeyInfo>, ConsoleKeyError>

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

Blocks for one key without echo, returning None at terminal EOF.

Return value

Result<Optional<ConsoleKeyInfo>, ConsoleKeyError>

A value containing logical key, modifiers and optional Unicode scalar, or a typed error.

Remarks

Allocates no per-key text or byte array. Invalid UTF-8 and unsupported sequences are consumed; an unrelated following byte is retained for the next read. Closing returns that byte to Console input.