This chapter describes functions that can be used to control interactive functions from your macros.
Void call (String fun)
This function is used to execute an interactive slrn internal
function. Such functions are used with setkey
statements in the
.slrnrc
startup files.
definekey, undefinekey, set_prefix_argument
definekey (String fun, String key, String km)
This function is used to bind a key sequence specified by key
to
a function fun
in the keymap km
. Here fun
can be any
predefined slang function that takes 0 arguments and returns void.
The parameter km
must be either "article", "group", or "readline".
undefinekey, call, set_prefix_argument
Int_Type get_prefix_arg ()
The get_prefix_arg
function returns the value of the prefix
argument. If no prefix argument has been set, the function returns
-1
, which is an impossible value for the prefix argument.
The prefix argument is specified interactively via the ESC key followed by one or more digits that determine value of the prefix argument.
This concept has been borrowed from the emacs text editor.
set_prefix_argument, reset_prefix_arg
Integer getkey ()
Read a character from the terminal and returns its value. Note: Function and arrow keys usually return more than one character.
ungetkey, input_pending, read_mini
Integer input_pending (Integer tsecs)
This function checks for keyboard input. Its argument specifies the number of tenths of a second to wait. It returns 0 if no input is available or a non-sero value if input is available.
getkey, ungetkey
Void reset_prefix_arg ()
The reset_prefix_arg
function may be used to reset the prefix
argument. This is usually necessary after calling to keep the
argument from propagating to other functions.
get_prefix_arg, set_prefix_argument
Void set_prefix_argument (Integer val)
The set_prefix_argument
function may be used to set the prefix
argument to val
. It is mainly used immediately before
calling
internal functions which take prefix arguments.
call
Void undefinekey (String key, String map)
This function undefineds a key sequence specified by key
from
keymap map
.
definekey
Void ungetkey (Integer ch)
This function pushes the character ch
back upon the input stream
such that the next call to getkey
will return it. It is possible
to push several characters back.
getkey