Previous Topic | Table of Contents | Next Topic

Function Keys


setkey command

The setkey command lets you define a list of words that should be stuffed back onto the command-line whenever you press a particular function key. The syntax is exactly the same as used in the set, setenv and alias commands:

setkey fkey [ = ] ( wordlist )
setkey
fkey [ = ] wordlist

where fkey is any of the function keys f1 (or F1) through f12 (or F12.)

setkey with no operands reports the current function key bindings, if any. setkey pattern lists the bindings for any keys whose names match the pattern. The corresponding unsetkey command discards key bindings:

setkey
setkey
pattern
unsetkey fkeylist
unsetkey pattern

The fkeylist should be typed with commas between the keys. For example:

unsetkey f1, f2


Using the Function Keys

Key
Meaning
<Fx> Clear the command line, post the text bound to this key and execute the command.
Alt-<Fx> Insert the text bound to this key at the cursor location but don't execute it yet.
Ctrl-<Fx> Clear the command line and post the text bound to this key but don't execute it yet.

Since the function key's bound text is written back into the command line inside command line editor, the substitution happens ahead of any parsing of the command line into words or expansion of history "!..." or "%..." references so it is possible to meaningfully embed these kinds of references into the key binding.



Previous Topic | Table of Contents | Next Topic

Copyright © 1988-2003 by Hamilton Laboratories. All rights reserved.