Phosphor::KeyChar
A printable ASCII character that has no named Key constant (digits,
punctuation, symbols).
Crystal enum members can't carry an associated value the way, say, a Rust
enum variant can — enum Key; Char(Char); end doesn't parse, and
nesting a struct inside Key to spell it Key::Char isn't allowed either
("can't declare type inside enum Key"). This record is the closest
equivalent: a value type holding the one character, unioned with Key
via KeyKind below so KeyEvent#key can hold either.
Constructors
Instance methods
char
clone
Sourcecopy_with(char _char = @char)
Source