Term2::Key
Key contains information about a keypress.
Keys can represent:
- Regular characters (type == KeyType::Runes)
- Special keys like arrows, function keys (type == KeyType::Up, etc.)
- Control combinations (type == KeyType::CtrlC, etc.)
- Alt combinations (alt? == true)
- Pasted text (paste? == true)
case msg
when Term2::KeyMsg
key = msg.key
case key.to_s
when "q" # quit
then
when "ctrl+c" # also quit
then
when "up" # move up
then
end
end
Constructors
Instance methods
==(other : Key)
Source