Next Previous Contents

5. Key Input Functions

This chapter describes functions that can be used to control interactive functions from your macros.

5.1 call

Usage

Void call (String fun)

Description

This function is used to execute an interactive slrn internal function. Such functions are used with setkey statements in the .slrnrc startup files.

See Also

definekey, undefinekey, set_prefix_argument

5.2 definekey

Usage

definekey (String fun, String key, String km)

Description

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".

See Also

undefinekey, call, set_prefix_argument

5.3 get_prefix_arg

Usage

Int_Type get_prefix_arg ()

Description

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.

Notes

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.

See Also

set_prefix_argument, reset_prefix_arg

5.4 getkey

Usage

Integer getkey ()

Description

Read a character from the terminal and returns its value. Note: Function and arrow keys usually return more than one character.

See Also

ungetkey, input_pending, read_mini

5.5 input_pending

Usage

Integer input_pending (Integer tsecs)

Description

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.

See Also

getkey, ungetkey

5.6 reset_prefix_arg

Usage

Void reset_prefix_arg ()

Description

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.

See Also

get_prefix_arg, set_prefix_argument

5.7 set_prefix_argument

Usage

Void set_prefix_argument (Integer val)

Description

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.

See Also

call

5.8 undefinekey

Usage

Void undefinekey (String key, String map)

Description

This function undefineds a key sequence specified by key from keymap map.

See Also

definekey

5.9 ungetkey

Usage

Void ungetkey (Integer ch)

Description

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.

See Also

getkey


Next Previous Contents