struct

Tea::Key

Inherits Tea::Msg < Struct < Value < Object

Key represents a keyboard key

Constructors

new(text : String = "", mod : KeyMod = 0, code : Int32 = 0, shifted_code : Int32 = 0, base_code : Int32 = 0, is_repeat : Bool = false)
Source

Instance methods

alt?
Source
base_code

BaseCode is the key pressed according to the standard PC-101 key layout.

Source
base_code=(base_code : Int32)

BaseCode is the key pressed according to the standard PC-101 key layout.

Source
code

Code represents the key pressed. This is usually a special key like KeyTab, KeyEnter, KeyF1, or a printable character like 'a'.

Source
code=(code : Int32)

Code represents the key pressed. This is usually a special key like KeyTab, KeyEnter, KeyF1, or a printable character like 'a'.

Source
ctrl?
Source
is_repeat=(is_repeat : Bool)

IsRepeat indicates whether the key is being held down and sending events repeatedly.

Source
is_repeat?

IsRepeat indicates whether the key is being held down and sending events repeatedly.

Source
keystroke

Go parity helper for Key.Keystroke().

Source
meta?
Source
mod

Mod represents modifier keys, like ModCtrl, ModAlt, and so on.

Source
mod=(mod : KeyMod)

Mod represents modifier keys, like ModCtrl, ModAlt, and so on.

Source
printable?

Check if this is a printable character

Source
rune

Go parity helper for Key.Rune().

Source
shift?
Source
shifted_code

ShiftedCode is the actual, shifted key pressed by the user.

Source
shifted_code=(shifted_code : Int32)

ShiftedCode is the actual, shifted key pressed by the user.

Source
string

Go parity helper for Key.String().

Source
text

Text contains the actual characters received. This usually the same as Code. When Text is non-empty, it indicates that the key pressed represents printable character(s).

Source
text=(text : String)

Text contains the actual characters received. This usually the same as Code. When Text is non-empty, it indicates that the key pressed represents printable character(s).

Source
to_s

Get the string representation

Source