Hamilton LaboratoriesHamilton C shell 2012User guideLanguage reference

Function keys

Oregon Coast

setkey statement
Previous | Next

Topics

Syntax
Usage
Using the function keys
F1 to open the user guide
See also

Syntax

setkey fkey [ = ] ( wordlist ) setkey fkey [ = ] wordlist setkey setkey pattern unsetkey fkeylist unsetkey pattern

Usage

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, where fkey is any of the function keys F1 through F12, case-insensitive.

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. The fkeylist can be typed with either spaces or commas between the names of the keys.

Using the function keys

Fn

Clear the command line, post the text bound to this key and execute the command.

Alt-Fn

Insert the text bound to this key at the cursor location but don't execute it yet.

Ctrl-Fn

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 ! or % history references so it is possible to meaningfully embed these kinds of references into the key binding.

F1 to open the user guide

The default startup.csh uses setkey to cause F1 to open the user guide.

#  Set f1 to open the user guide.
setkey   f1    open ^$shell:h:h\UserGuide\index.htm

$shell refers to the path to the currently running csh.exe; escaping the $ with ^ defers evaluation to run-time, simply to avoid dealing with a path that contains spaces. The :h operator returns the directory containing.

See also

Variable substitution
Substitution modifiers
Wildcard characters
Command line editing
History recall
Command completion
Tutorial: Variables
Tutorial: Expressions
Tutorial: Wildcarding
Tutorial: Command line editing
Tutorial: History

Previous | Next

Getting started with Hamilton C shell

Hamilton C shell, as it first wakes up.

Getting started with Hamilton C shell

A first few commands.

You can set the screen colors to your taste.

You can set the screen colors to your taste.