struct TUI::KeyEvent

Overview

A single parsed input event. #char is only meaningful when key == Key::Char (the literal typed character); #row/#col are only set for Key::MouseClick (1-based terminal coordinates — see Keys.parse_sgr_mouse) and nil for every other kind, including the wheel events, which carry no position; #text is only set for Key::Paste (the full pasted content between bracketed-paste markers — see Keys.parse_bracketed_paste), nil otherwise.

Defined in:

tui/core/keys.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(key : Key, char : Char = '\0', row : Int32 | Nil = nil, col : Int32 | Nil = nil, text : String | Nil = nil) #

[View source]

Instance Method Detail

def char : Char #

def clone #

[View source]
def col : Int32 | Nil #

def copy_with(key _key = @key, char _char = @char, row _row = @row, col _col = @col, text _text = @text) #

[View source]
def key : Key #

def row : Int32 | Nil #

def text : String | Nil #