What's wrong
TUI/Services/SpectreConsoleProvider.cs (around lines 84-96) reads a key with Console.ReadKey(true) and returns InputResult.FromKey(keyInfo.Key, keyInfo.Modifiers). It discards keyInfo.KeyChar.
The model supports characters: InputResult.Character, InputResult.FromCharacter and InputType.Character all exist (TUI/Models/InputResult.cs:54). But nothing in the repository creates a character result. SpectreConsoleProvider is the only real provider, so no element can ever receive one.
Failure scenario
- Typing
! reaches the element as ConsoleKey.D1 + Shift, so it cannot tell ! from 1.
/, ?, @, " arrive as Oem* keys, which differ from one keyboard layout to another.
- Caps Lock state is lost, so upper and lower case can't be recovered reliably.
- Non-US layouts and dead-key or IME composition produce the wrong characters.
As a result, a text box, search field, or any other text-entry element can't be built on this library.
Suggested fix / acceptance criteria
- When
keyInfo.KeyChar is printable (not '\0' and not a control character), fill in InputResult.Character as well as the key and modifiers.
- Filling in both fields keeps existing key-based handlers working.
- Add a provider-level or
InputResult test showing that a Shift+D1 key info carries Character == '!'.
What's wrong
TUI/Services/SpectreConsoleProvider.cs(around lines 84-96) reads a key withConsole.ReadKey(true)and returnsInputResult.FromKey(keyInfo.Key, keyInfo.Modifiers). It discardskeyInfo.KeyChar.The model supports characters:
InputResult.Character,InputResult.FromCharacterandInputType.Characterall exist (TUI/Models/InputResult.cs:54). But nothing in the repository creates a character result.SpectreConsoleProvideris the only real provider, so no element can ever receive one.Failure scenario
!reaches the element asConsoleKey.D1+ Shift, so it cannot tell!from1./,?,@,"arrive asOem*keys, which differ from one keyboard layout to another.As a result, a text box, search field, or any other text-entry element can't be built on this library.
Suggested fix / acceptance criteria
keyInfo.KeyCharis printable (not'\0'and not a control character), fill inInputResult.Characteras well as the key and modifiers.InputResulttest showing that a Shift+D1 key info carriesCharacter == '!'.