Liking cljdoc? Tell your friends :D

lanterna.terminal


add-resize-listenerclj

(add-resize-listener terminal listener-fn)

Create a listener that will call the supplied fn when the terminal is resized.

The function must take two arguments: the new number of columns and the new number of rows.

The listener itself will be returned. You don't need to do anything with it, but you can use it to remove it later with remove-resize-listener.

Create a listener that will call the supplied fn when the terminal is resized.

The function must take two arguments: the new number of columns and the new
number of rows.

The listener itself will be returned.  You don't need to do anything with it,
but you can use it to remove it later with remove-resize-listener.

sourceraw docstring

clearclj

(clear terminal)

Clear the terminal.

The cursor will be at 0 0 afterwards.

Clear the terminal.

The cursor will be at 0 0 afterwards.

sourceraw docstring

flushclj

(flush terminal)
sourceraw docstring

get-keyclj

(get-key terminal)

Get the next keypress from the user, or nil if none are buffered.

If the user has pressed a key, that key will be returned (and popped off the buffer of input).

If the user has not pressed a key, nil will be returned immediately. If you want to wait for user input, use get-key-blocking instead.

Get the next keypress from the user, or nil if none are buffered.

If the user has pressed a key, that key will be returned (and popped off the
buffer of input).

If the user has *not* pressed a key, nil will be returned immediately.  If you
want to wait for user input, use get-key-blocking instead.

sourceraw docstring

get-key-blockingclj

(get-key-blocking terminal)
(get-key-blocking terminal {:keys [interval timeout] :as opts})

Get the next keypress from the user.

If the user has pressed a key, that key will be returned (and popped off the buffer of input).

If the user has not pressed a key, this function will block, checking every 50ms. If you want to return nil immediately, use get-key instead.

Options can include any of the following keys:

:interval - sets the interval between checks :timeout - sets the maximum amount of time blocking will occur before returning nil

Get the next keypress from the user.

If the user has pressed a key, that key will be returned (and popped off the
buffer of input).

If the user has *not* pressed a key, this function will block, checking every
50ms.  If you want to return nil immediately, use get-key instead.

Options can include any of the following keys:

:interval - sets the interval between checks
:timeout  - sets the maximum amount of time blocking will occur before
            returning nil

sourceraw docstring

get-sizeclj

(get-size terminal)

Return the current size of the terminal as [cols rows].

Return the current size of the terminal as [cols rows].
sourceraw docstring

get-terminalclj

(get-terminal)
(get-terminal kind)
(get-terminal kind _opts)
source

in-terminalcljmacro

(in-terminal terminal & body)

Start the given terminal, perform the body, and stop the terminal afterward.

Start the given terminal, perform the body, and stop the terminal afterward.
sourceraw docstring

move-cursorclj

(move-cursor terminal x y)

Move the cursor to a specific location on the screen.

Move the cursor to a specific location on the screen.
sourceraw docstring

put-characterclj

(put-character terminal ch)
(put-character terminal ch x y)

Draw the character at the current cursor location.

If x and y are given, moves the cursor there first.

Moves the cursor one character to the right, so a sequence of calls will output next to each other.

Draw the character at the current cursor location.

If x and y are given, moves the cursor there first.

Moves the cursor one character to the right, so a sequence of calls will
output next to each other.

sourceraw docstring

put-stringclj

(put-string terminal s)
(put-string terminal s column row)
source

remove-resize-listenerclj

(remove-resize-listener terminal listener)

Remove a resize listener from the given terminal.

Remove a resize listener from the given terminal.
sourceraw docstring

set-bg-colorclj

(set-bg-color terminal color)
source

set-fg-colorclj

(set-fg-color terminal color)
source

set-styleclj

(set-style terminal style)

Enter a style

Enter a style
sourceraw docstring

startclj

(start terminal)

Start the terminal. Consider using in-terminal instead.

Start the terminal.  Consider using in-terminal instead.
sourceraw docstring

stopclj

(stop terminal)

Stop the terminal. Consider using in-terminal instead.

Stop the terminal.  Consider using in-terminal instead.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close