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

API Browser

Constructor

.ctor

init(Key: ConsoleKey, Shift: bool, Alt: bool, Control: bool, TextScalar: Optional<int>) -> void

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

A decoded key value. TextScalar is a Unicode scalar, not a grapheme or an allocated String.

Parameters

Name Type Description
Key ConsoleKey
Shift Boolean
Alt Boolean
Control Boolean
TextScalar Optional<Int32>

Remarks

Shift is reported only when explicitly encoded; uppercase text alone does not imply Shift. Legacy terminals cannot distinguish Tab from Ctrl+I, Enter from Ctrl+M or Backspace from Ctrl+H. Compiler-generated self-equality interface compares all fields, including the active TextScalar case and scalar value. Equal keys have equal hashes; None, Some(0) and an uninitialized Optional are distinct.