[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 Programming the Input Bar

New input behavior can be added to the input bar by creating editing functions and binding them to keys in the *input-map* using define-key, just like other key bindings.

An input function takes 2 arguments: the input structure and the key pressed.

Function: read-one-line screen prompt &key (initial-input ) require-match password

Read a line of input through stumpwm and return it. returns nil if the user aborted.

Function: read-one-char screen

Read a single character from the user.

Function: completing-read screen prompt completions &key (initial-input ) require-match

Read a line of input through stumpwm and return it with TAB completion. completions can be a list, an fbound symbol, or a function. if its an fbound symbol or a function then that function is passed the substring to complete on and is expected to return a list of matches. If require-match argument is non-nil then the input must match with an element of the completions.

Function: input-insert-string input string

Insert string into the input at the current position. input must be of type input-line. Input functions are passed this structure as their first argument.

Function: input-insert-char input char

Insert char into the input at the current position. input must be of type input-line. Input functions are passed this structure as their first argument.

Variable: *input-map*

This is the keymap containing all input editing key bindings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on January 28, 2024 using texi2html 1.82.