.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
-------------------------------------------------------------------------------
.3270keys
PURPOSE
Defines a user keyboard mapping for TELNET (3270).
SYNOPSIS
$HOME/.3270keys
DESCRIPTION
The .3270keys file contains your customized key-binding profile, which exists
as a hidden file (the name begins with a ., or a dot) in your home directory.
TELNET (3270) looks first in your home directory for .3270keys. If one is
present, TELNET (3270) uses it to bind keys to functions; otherwise, TELNET
(3270) uses the standard profile, /etc/3270.keys. Since these two profiles are
mutually exclusive, the profile you create must specify all the bindings you
want, rather than only those for which you would like an alternate.
When creating a $HOME/.3270keys file, you may use /etc/3270keys.hft as an
initial template. The file /etc/3270keys.hft is the default keybinding profile
for PS2/HFT terminals. It is used by TELNET(3270) for keybinding when $TERM is
set to "hft", "hft-c", "ibm8512", "ibm8513", or "ibm8514". If $TERM is set to
any other terminal type, the default keybinding described in /etc/3270.keys is
used.
KEY-SEQUENCES
A key-sequence is a sequence of characters. It can be delimited optionally by
single (') or double quotes ("""). If the key-sequence contains white space,
carriage returns, or keywords, such as bind or load, then the key sequence must
be delimited by quote marks.
^ Indicates that the following character is to be converted to a control
character.
Note: Converting the following character to a control character is done
by masking out all but the low 5 bits of the character, therefore, ^?
(077) and ^_(0137) both yield 037.
~ Indicates that the following character is to be converted into a
character beyond the ASCII set; that is, the resulting character has the
eighth bit turned on; for example, C (0103) yields 0303.
\e The escape key (033).
Note: Keep in mind that you cannot map a 3270 function to the ESC key
Processed October 29, 1990 .3270KEYS(5,F) 1
.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
alone. You can specify the ESC key only in combinations with another
key.
\b Blank
\t Tab
\r Carriage return
\n Line feed
KEY-BINDING GRAMMAR
The following is a BNF description of the 3270-key-binding grammar.
listing ->
/* empty set */
|listing statement
|listing conditional statement
statements ->
bind 3270-function key sequence.
|bind 3270-attribute color
|load filename
|print string
|quit
|exit
conditions ->
string \ condition or condition
conditional statements ->
if condition
|else
3270 functions ->
backspace|backtab|character|clear
|delete|down|dup|enter|eraseof|eraseinput
|fieldmark|home|illegal|insertmode|left
|pa1|pa2||pa3
Processed October 29, 1990 .3270KEYS(5,F) 2
.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
|penselect
|pf1|pf2|pf3|pf4|pf5
|pf6|pf7|pf8|pf9|pf10
|pf11|pf12|pf13|pf14|pf15 |pf16|pf17|pf18|pf19|pf20
|pf21|pf22|pf23|pf24|pf25 |reset|return|right|sysreq
|tab|up|wordnext|wordprev
3270 attributes ->
background
|high_prot|high_unprot
|low_prot|low_unprot
color -> black|blue|brown|cyan|green
|magenta|red|white|brightblack
|brightblue|brightbrown|brightcyan
|brightgreen|brightmagenta|brightred
|brightwhite
STATEMENTS
bind 3270 function key sequence
Binds a 3270 terminal function to a sequence of key strokes.
bind 3270 attribute color
Binds a 3270 field attribute to a color.
load string
Tells the parser to read in the file name specified by string for
additional listings. String can be delimited optionally by single or
double quotes. If the string is identical to a keyword, then string
must be delimited by quote marks.
print string
Prints the string to stdout. This command is useful for debugging
listings.
exit Unconditionally ends the parse process. No further input is parsed,
TELNET (3270) begins remote login.
quit Unconditionally ends the parse process. No further input is parsed,
TELNET (3270) begins remote login.
Processed October 29, 1990 .3270KEYS(5,F) 3
.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
CONDITIONS
Conditions are evaluated by comparing the condition string against the terminal
setting. The terminal setting is specified by your environ- ment variable
TERM. Thus the following listing loads /etc/3270keys.hft if TERM is set to hft
or hft-c; otherwise, it loads the user generated keybinding file,
/etc/3270keys.specialterm:
if hft or hft-c - load /etc/3270keys.hft
else - load /etc/3270keys.specialterm
CONDITIONAL STATEMENTS
As indicated by the grammar, only one statement may follow an if or else
conditional expression. Also, conditional expressions may not be nested. Due
to this limitation of the language, bindings for specific terminals or families
of terminals should be stored in separate files.
For example, the following correctly gives either hft or user generated key
bindings:
if hft or hft-c
load /etc/3270keys.hft
else
load /etc/keys.specialterm
The following, however, will bind functions pf2 through pf10 to escN regardless
of the terminal type:
if hft or hft-c
load /etc/3270keys.hft
else
bind pf1 "\1"
bind pf2 "\2"
.
.
.
bind pf9 "\9"
bind pf10 "\0"
Since it may be desirable to support key bindings for a variety of families of
terminals, and since conditional expressions are limited, testing for a default
may not be straightforward. The following example, for instance, will not
work, since conditional expressions cannot be nested.
Processed October 29, 1990 .3270KEYS(5,F) 4
.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
if hft or hft-c
load /etc/3270keys.hft
else if hds
load /etc/3270keys.hds
else if avt
load /etc/3270keys.avt
else
load /etc/3270keys.dflt
This limitation in the language can be overcome, by using the exit or quit
statement as an unconditional break. The following example loads the correct
file for all terminals:
if hft or hft-c
load /etc/3270keys.hft
if hft or hft-c
quit
if hds
load /etc/3270keys.hds
if hds
quit
if avt
load /etc/3270keys.avt
if avt
quit
load /etc/3270keys.dflt
Note: The files /etc/3270keys.dflt, /etc/3270keys.hds and /etc/3270keys.avt
are used here only as examples. They are not part of AIX/370 or AIX PS/2.
3270 FUNCTIONS
Binding a key sequence to an illegal character causes an alarm to sound
whenever that sequence is entered.
By default, all standard characters are bound to characters. Binding a key to
a character causes that key to be treated as a character. A character should
not be bound to a sequence of more than one character.
Penselect is not supported. Binding a key sequence to penselect will cause an
error message to be printed to stderr whenever that key sequence is entered.
3270 ATTRIBUTE
The following description of 3270 attributes is an informal one, since
attributes are used in different ways by different VM applications.
background
background field
Processed October 29, 1990 .3270KEYS(5,F) 5
.3270KEYS(5,F) AIX TCP/IP User's Guide .3270KEYS(5,F)
high_prot High intensity protected attribute. Attribute of CMS XEDIT status
field for status.
high_unprot
High intensity unprotected attribute. Attribute of CMS FILELIST data
field.
low_prot Low intensity protected attribute. Attribute of CP commands output.
COLORS
Notice that brightbrown is yellow for most terminals. Some bright colors may
not be supported by your terminal.
FILES
/etc/3270.keys Standard key binding profile.
/etc/3270keys.hft Key-bindings for PS2/HFT terminals.
RELATED INFORMATION
In this book: "telnet, tn, tn3270"
Processed October 29, 1990 .3270KEYS(5,F) 6