Liking cljdoc? Tell your friends :D

charm.message

Message types for charm.clj TUI applications.

Messages are plain maps with a :type key for easy pattern matching. Use factory functions to create messages and predicates to check types.

Message types for charm.clj TUI applications.

Messages are plain maps with a :type key for easy pattern matching.
Use factory functions to create messages and predicates to check types.
raw docstring

alt?clj

(alt? msg)

Check if alt modifier is set.

Check if alt modifier is set.
sourceraw docstring

blurclj

(blur)

Create a focus lost (blur) message.

Create a focus lost (blur) message.
sourceraw docstring

blur?clj

(blur? msg)

Check if message is a blur event.

Check if message is a blur event.
sourceraw docstring

ctrl?clj

(ctrl? msg)

Check if ctrl modifier is set.

Check if ctrl modifier is set.
sourceraw docstring

errorclj

(error throwable)

Create an error message.

Create an error message.
sourceraw docstring

error?clj

(error? msg)

Check if message is an error.

Check if message is an error.
sourceraw docstring

focusclj

(focus)

Create a focus gained message.

Create a focus gained message.
sourceraw docstring

focus?clj

(focus? msg)

Check if message is a focus event.

Check if message is a focus event.
sourceraw docstring

key-match?clj

(key-match? msg key)

Check if a key-press message matches the given key.

Key can be:

  • A string like "q", "a" (matches character keys)
  • A keyword like :enter, :up, :tab (matches special keys)
  • A pattern like "ctrl+c" (matches with modifiers)
Check if a key-press message matches the given key.

Key can be:
- A string like "q", "a" (matches character keys)
- A keyword like :enter, :up, :tab (matches special keys)
- A pattern like "ctrl+c" (matches with modifiers)
sourceraw docstring

key-pressclj

(key-press key
           &
           {:keys [alt ctrl shift] :or {alt false ctrl false shift false}})

Create a key press message.

Options: :alt - Alt key modifier (default false) :ctrl - Ctrl key modifier (default false) :shift - Shift key modifier (default false)

Create a key press message.

Options:
  :alt   - Alt key modifier (default false)
  :ctrl  - Ctrl key modifier (default false)
  :shift - Shift key modifier (default false)
sourceraw docstring

key-press?clj

(key-press? msg)

Check if message is a key press.

Check if message is a key press.
sourceraw docstring

mouseclj

(mouse action
       button
       x
       y
       &
       {:keys [alt ctrl shift] :or {alt false ctrl false shift false}})

Create a mouse event message.

Action is one of: :press :release :motion :wheel-up :wheel-down Button is one of: :left :middle :right :none

Create a mouse event message.

Action is one of: :press :release :motion :wheel-up :wheel-down
Button is one of: :left :middle :right :none
sourceraw docstring

mouse?clj

(mouse? msg)

Check if message is a mouse event.

Check if message is a mouse event.
sourceraw docstring

msg-typeclj

(msg-type msg)

Get the type of a message.

Get the type of a message.
sourceraw docstring

quitclj

(quit)

Create a quit message to exit the program.

Create a quit message to exit the program.
sourceraw docstring

quit?clj

(quit? msg)

Check if message is a quit signal.

Check if message is a quit signal.
sourceraw docstring

shift?clj

(shift? msg)

Check if shift modifier is set.

Check if shift modifier is set.
sourceraw docstring

window-sizeclj

(window-size width height)

Create a window size message.

Create a window size message.
sourceraw docstring

window-size?clj

(window-size? msg)

Check if message is a window size change.

Check if message is a window size change.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close