struct Termbox::Event::KeyEvent

Overview

Emitted by those key press events that are not representable by a printable(-ish) Char and a modifier.

Defined in:

termbox2/event.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from struct Termbox::Event::BaseEvent

initialize initialize

Constructor methods inherited from struct Termbox::Event::BaseEvent

new new

Class methods inherited from struct Termbox::Event::BaseEvent

from(event : LibTermbox::Event) from

Constructor Detail

def self.new(key : Termbox::Key | Nil, char : Char | Nil, mod : Termbox::KeyModifier) #

[View source]

Class Method Detail

def self.from(event) #

Creates a KeyEvent from a Termbox event struct.


[View source]

Instance Method Detail

def char : Char | Nil #

Returns the char that was pressed. Either this or #key is available for key events.


[View source]
def key : Key | Nil #

Returns the key that was pressed. Either this or #char is available for key events.


[View source]
def mod : KeyModifier #

Returns the key modifier.


[View source]