class Novika::Capabilities::Impl::Console
Defined in:
novika/capabilities/impl/console.crInstance Method Summary
-
#append_echo(engine, x : Decimal, y : Decimal, fg : Color, bg : Color, quote : Quote)
Appends echo of quote colorized with fg and bg colors at the given x and y position (in columns, rows).
- #change(engine, x : Decimal, y : Decimal, fg : Color, bg : Color)
-
#clear(engine, fg : Color, bg : Color)
Clears the console with fg and bg colors.
-
#colors_256(engine)
Enables the 256-color output mode.
-
#colors_compat(engine)
Enables the compatibility color (8-color) output mode.
-
#colors_truecolor(engine)
Enables the truecolor output mode.
-
#get_char_pressed(engine) : Quote
Returns char quote for the key that was pressed.
-
#had_alt_pressed?(engine) : Boolean
Returns whether the ALT key was pressed.
-
#had_backspace_pressed?(engine) : Boolean
Returns whether the Backspace key was pressed.
-
#had_char_pressed?(engine) : Boolean
Returns whether EXCLUSIVELY a printable character key was pressed (no CTRL, ALT, etc.) Whether the SHIFT key was pressed or not is ignored.
-
#had_ctrl_pressed?(engine) : Boolean
Returns whether the CTRL key was pressed.
-
#had_delete_pressed?(engine) : Boolean
Returns whether the DELETE key was pressed.
-
#had_down_pressed?(engine) : Boolean
Returns whether the DOWN ARROW key was pressed.
-
#had_end_pressed?(engine) : Boolean
Returns whether the END key was pressed.
-
#had_fn_pressed?(engine) : Boolean
Returns whether one of the function keys F1-F12 was pressed.
-
#had_home_pressed?(engine) : Boolean
Returns whether the HOME key was pressed.
-
#had_insert_pressed?(engine) : Boolean
Returns whether the INSERT key was pressed.
-
#had_key_pressed?(engine) : Boolean
Returns whether any key was pressed.
-
#had_left_pressed?(engine) : Boolean
Returns whether the LEFT ARROW key was pressed.
-
#had_pgdn_pressed?(engine) : Boolean
Returns whether the PAGE DOWN key was pressed.
-
#had_pgup_pressed?(engine) : Boolean
Returns whether the PAGE UP key was pressed.
-
#had_right_pressed?(engine) : Boolean
Returns whether the RIGHT ARROW key was pressed.
-
#had_shift_pressed?(engine) : Boolean
Returns whether the SHIFT key was pressed.
-
#had_up_pressed?(engine) : Boolean
Returns whether the UP ARROW key was pressed.
-
#off(engine)
Disables the Console API.
-
#on(engine)
Enables the Console API.
-
#present(engine)
Syncs the internal buffer with console.
-
#read_key(engine, timeout : Decimal)
Peeks or waits for input.
-
#size(engine) : Tuple(Decimal, Decimal)
Returns the console width (in columns) and height (in rows).
Instance methods inherited from class Novika::Capabilities::IConsole
append_echo(engine, x : Decimal, y : Decimal, fg : Color, bg : Color, quote : Quote)
append_echo,
bg
bg,
clear(engine, fg : Color, bg : Color)
clear,
colors_256(engine)
colors_256,
colors_compat(engine)
colors_compat,
colors_truecolor(engine)
colors_truecolor,
fg
fg,
get_char_pressed(engine) : Quote
get_char_pressed,
had_alt_pressed?(engine) : Boolean
had_alt_pressed?,
had_backspace_pressed?(engine) : Boolean
had_backspace_pressed?,
had_char_pressed?(engine) : Boolean
had_char_pressed?,
had_ctrl_pressed?(engine) : Boolean
had_ctrl_pressed?,
had_delete_pressed?(engine) : Boolean
had_delete_pressed?,
had_down_pressed?(engine) : Boolean
had_down_pressed?,
had_end_pressed?(engine) : Boolean
had_end_pressed?,
had_fn_pressed?(engine) : Boolean
had_fn_pressed?,
had_home_pressed?(engine) : Boolean
had_home_pressed?,
had_insert_pressed?(engine) : Boolean
had_insert_pressed?,
had_key_pressed?(engine) : Boolean
had_key_pressed?,
had_left_pressed?(engine) : Boolean
had_left_pressed?,
had_pgdn_pressed?(engine) : Boolean
had_pgdn_pressed?,
had_pgup_pressed?(engine) : Boolean
had_pgup_pressed?,
had_right_pressed?(engine) : Boolean
had_right_pressed?,
had_shift_pressed?(engine) : Boolean
had_shift_pressed?,
had_up_pressed?(engine) : Boolean
had_up_pressed?,
inject(into target)
inject,
off(engine)
off,
on(engine)
on,
present(engine)
present,
read_key(engine, timeout : Decimal)
read_key,
size(engine) : Tuple(Decimal, Decimal)
size
Class methods inherited from class Novika::Capabilities::IConsole
id : String
id,
on_by_default? : Bool
on_by_default?,
purpose : String
purpose
Instance methods inherited from module Novika::ICapability
capabilities : CapabilityCollection
capabilities,
inject(into target : Block)
inject
Constructor methods inherited from module Novika::ICapability
new(capabilities)
new
Instance Method Detail
Appends echo of quote colorized with fg and bg colors at the given x and y position (in columns, rows).
Clears the console with fg and bg colors.
Enables the 256-color output mode.
Enables the compatibility color (8-color) output mode.
Enables the truecolor output mode.
Returns char quote for the key that was pressed. Usually a lowercase
or uppercase letter; but also may look like '\\n'
or '\\t'
, etc.)
In case the key that was pressed cannot be represented by the means of a quote, or if the user did not press any key, an empty quote is returned.
Returns whether the ALT key was pressed.
Returns whether the Backspace key was pressed.
Returns whether EXCLUSIVELY a printable character key was pressed (no CTRL, ALT, etc.) Whether the SHIFT key was pressed or not is ignored.
Returns whether the CTRL key was pressed.
Returns whether the DELETE key was pressed.
Returns whether the DOWN ARROW key was pressed.
Returns whether the END key was pressed.
Returns whether one of the function keys F1-F12 was pressed.
Returns whether the HOME key was pressed.
Returns whether the INSERT key was pressed.
Returns whether the LEFT ARROW key was pressed.
Returns whether the PAGE DOWN key was pressed.
Returns whether the PAGE UP key was pressed.
Returns whether the RIGHT ARROW key was pressed.
Returns whether the SHIFT key was pressed.
Returns whether the UP ARROW key was pressed.
Disables the Console API.
Enables the Console API.
Syncs the internal buffer with console.
Peeks or waits for input. Refreshes the input state.
-
Negative timeout must wait indefinitely for input, and after receiving input refresh the state.
-
Zero timeout must refresh the input state without waiting for input.
-
Positive timeout must wait for input in a window timeout milliseconds long, and refresh the input state after receiving input.
Returns the console width (in columns) and height (in rows).