ExTermbox v0.3.4 ExTermbox.Constants View Source
Defines constants from the termbox library. These can be used e.g. to set a formatting attributes or to identify keys passed in an event.
Link to this section Summary
Functions
Retrieves an attribute constant by name
Retrieves the mapping of attribute constants
Retrieves a color constant by name
Retrieves the mapping of color constants
Retrieves an error code constant by name
Retrieves the mapping of error code constants
Retrieves an event type constant by name
Retrieves the mapping of event type constants
Retrieves the hide cursor constant
Retrieves an input mode constant by name
Retrieves the mapping of input mode constants
Retrieves a key constant by name
Retrieves the mapping of key constants for use with termbox
Retrieves an output mode constant by name
Retrieves the mapping of output mode constants
Link to this section Types
attribute()
View Source
attribute() :: constant()
attribute() :: constant()
color()
View Source
color() :: constant()
color() :: constant()
constant()
View Source
constant() :: integer()
constant() :: integer()
error_code()
View Source
error_code() :: constant()
error_code() :: constant()
event_type()
View Source
event_type() :: constant()
event_type() :: constant()
hide_cursor()
View Source
hide_cursor() :: constant()
hide_cursor() :: constant()
input_mode()
View Source
input_mode() :: constant()
input_mode() :: constant()
key()
View Source
key() :: constant()
key() :: constant()
output_mode()
View Source
output_mode() :: constant()
output_mode() :: constant()
Link to this section Functions
attribute(name) View Source
Retrieves an attribute constant by name
Examples
iex> attribute(:bold)
0x0100
iex> attribute(:underline)
0x0200
attributes() View Source
Retrieves the mapping of attribute constants.
color(name) View Source
Retrieves a color constant by name
Examples
iex> color(:red)
0x02
iex> color(:blue)
0x05
colors() View Source
Retrieves the mapping of color constants.
error_code(name)
View Source
error_code(atom()) :: error_code()
error_code(atom()) :: error_code()
Retrieves an error code constant by name
Examples
iex> error_code(:unsupported_terminal)
-1
error_codes()
View Source
error_codes() :: %{optional(atom()) => error_code()}
error_codes() :: %{optional(atom()) => error_code()}
Retrieves the mapping of error code constants.
event_type(name)
View Source
event_type(atom()) :: event_type()
event_type(atom()) :: event_type()
Retrieves an event type constant by name
Examples
iex> event_type(:key)
0x01
iex> event_type(:resize)
0x02
iex> event_type(:mouse)
0x03
event_types()
View Source
event_types() :: %{optional(atom()) => event_type()}
event_types() :: %{optional(atom()) => event_type()}
Retrieves the mapping of event type constants.
hide_cursor()
View Source
hide_cursor() :: hide_cursor()
hide_cursor() :: hide_cursor()
Retrieves the hide cursor constant.
Examples
iex> hide_cursor()
-1
input_mode(name)
View Source
input_mode(atom()) :: input_mode()
input_mode(atom()) :: input_mode()
Retrieves an input mode constant by name
Examples
iex> input_mode(:esc)
1
iex> input_mode(:esc_with_mouse)
5
input_modes()
View Source
input_modes() :: %{optional(atom()) => input_mode()}
input_modes() :: %{optional(atom()) => input_mode()}
Retrieves the mapping of input mode constants.
key(name) View Source
Retrieves a key constant by name
Examples
iex> key(:esc)
0x1B
iex> key(:space)
0x20
keys() View Source
Retrieves the mapping of key constants for use with termbox.
These are based on terminfo constants. Note that there's some overlap
of terminfo values. For example, it's not possible to distinguish between
<backspace>
and ctrl-h
.
output_mode(name)
View Source
output_mode(atom()) :: output_mode()
output_mode(atom()) :: output_mode()
Retrieves an output mode constant by name
Examples
iex> output_mode(:term_256)
2
output_modes()
View Source
output_modes() :: %{optional(atom()) => output_mode()}
output_modes() :: %{optional(atom()) => output_mode()}
Retrieves the mapping of output mode constants.