Initial import from FreeBSD RELENG_4:
[games.git] / usr.sbin / pcvt / userkeys / vt220keys.1
1 .\" $FreeBSD: src/usr.sbin/pcvt/userkeys/vt220keys.1,v 1.7.2.3 2003/03/11 22:31:30 trhodes Exp $
2 .\"
3 .Dd January 16, 2001
4 .Dt VT220KEYS 1
5 .Os
6 .Sh NAME
7 .Nm vt220keys
8 .Nd "define SHIFTED function keys on VT220 terminal"
9 .Sh SYNOPSIS
10 .Nm
11 .Op Fl cil
12 .Op Ar keyname keystring ...
13 .Sh DESCRIPTION
14 The
15 .Nm
16 utility sets up a
17 .Dq "vt220 terminal"
18 in vt200 mode to allow user
19 definition of the SHIFTED function keys.
20 Each
21 .Ar keyname
22 specified on the command line will be loaded with
23 the corresponding
24 .Ar keystring .
25 A
26 .Ar keyname
27 is one of the following words:
28 .Cm F6 F7 F8 F9 F10 F11 ESC
29 .Cm F12 BS F13 LF F14 HELP
30 .Cm DO F17 F18 F19 F20 .
31 .Ar Keystrings
32 must be quoted if spaces, tabs, or shell metacharacters are included.
33 .Pp
34 The
35 .Nm
36 utility expects to receive some combination of option flags and/or
37 argument pair(s), otherwise a usage message
38 is printed.
39 .Pp
40 The options are:
41 .Bl -tag -width indent
42 .It Fl c
43 Clears all SHIFTED function key definitions before setting them to user
44 defined strings.
45 .It Fl i
46 Read the initialization file
47 .Pa $HOME/.vt220rc
48 for SHIFTED function key definitions.
49 This is done before any
50 argument pair specified on the command line is processed.
51 Each line in the file must consist of two fields (separated by spaces
52 or tabs) where the first field is the
53 .Ar keyname
54 and the second field is the
55 .Ar keystring .
56 The second field extends to the end of the line, thus a
57 .Ar keystring
58 may include spaces or tabs.
59 A newline (return) may be specified
60 within the string by using the C Language notation for newline (\\n).
61 .It Fl l
62 Locks the function keys from further definition.
63 Locking occurs after processing the initialization file (if the
64 .Fl i
65 option is specified) and any argument
66 pairs.
67 The only way
68 to unlock is by turning the power off.
69 .El
70 .Sh EXAMPLES
71 .Bd -literal
72 vt220keys -ci
73 vt220keys F6 'nroff -ms '
74 vt220keys -i F20 'cc -O -c '
75 vt220keys -l HELP man
76 .Ed
77 .Sh "OTHER FEATURES"
78 Pressing the function keys without using the shift key, generates
79 a string of characters.
80 With
81 .Xr csh 1
82 this string can be aliased to some command.
83 For example:
84 .Pp
85 .Dl alias\ ^[[17~\ "ls\ -CR\ |\ more"
86 .Pp
87 where
88 .Ql "^[[17~"
89 is what is generated by pressing the F6 key.
90 Therefore
91 F6 can perform two commands, depending if pressed with/without the SHIFT
92 key.
93 .Pp
94 The
95 .Nm
96 utility can be called from your
97 .Pa .login
98 or
99 .Pa .profile
100 file.
101 Typically an user
102 will create an initialization file and include a line like
103 .Pp
104 .Dl "vt220keys -ci"
105 OR
106 .Dl "vt220keys -cil"
107 .Pp
108 in the above mentioned files.
109 This way the SHIFTED function keys
110 will be set to your favorite commands when logging in.
111 .Sh CAVEATS
112 If the SHIFTED function keys are unlocked, redefinition of a SHIFTED
113 function key will rewrite the old string.
114 .Pp
115 There are 256 bytes available for the SHIFTED function keys.
116 Space is
117 supplied on a first\-come/first\-serve basis.
118 After the 256 bytes are
119 used, you can't define any more keys unless space is cleared.
120 This
121 can be done by redefining a key to contain a string of fewer bytes.
122 .Pp
123 All key definitions are stored in volatile RAM, and are lost when
124 terminal power is lost.
125 .Pp
126 The ESC key (unshifted) no longer generates the proper escape character.
127 This
128 is of particular importance since many editors require use of the
129 ESC key.
130 Here are some available alternatives:
131 .Bl -bullet
132 .It
133 The escape character can be generated by typing
134 .Ql ^[
135 (control\-[).
136 .It
137 Use
138 .Nm
139 as follows (note
140 .Ql ^[
141 is control\-[)
142 .Pp
143 .Dl "vt220keys ESC '^['"
144 .Pp
145 This will require you
146 to press the SHIFT key and ESC to generate the escape sequence.
147 .It
148 Some editors, allow other character(s) to be substituted for the
149 escape character.
150 For example with
151 .Xr emacs 1
152 include this line in your
153 .Pa .emacs_pro :
154 .Pp
155 .Dl (bind-to-key\ "ESC-prefix"\ "\\033[23~")
156 .Pp
157 Thus when the ESC key is pressed,
158 .Nm emacs
159 will allow the characters generated
160 .Pq Li ^[[23~
161 to perform the same function as the escape
162 character.
163 .El
164 .Sh FILES
165 .Bl -tag -width $HOME/.vt220rc
166 .It Pa $HOME/.vt220rc
167 initialization file
168 .El
169 .Sh SEE ALSO
170 .Rs
171 .%B "VT220 Programmer Reference Manual"
172 .Re
173 .Rs
174 .%B "VT220 Programmer Pocket Guide"
175 .Re