File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / usr.bin / bsc / doc / emhelp.txt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:26:12 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

.RP
.TL
How to Set Up Termcap Entries for EM3277 Keyboard Mapping
.AU
Risa Galant
.AI
D. L. Buck and Associates, Inc.
.AB
.PP
The IBM 3277 terminal keyboard has many special-purpose keys unique
to it which are used by applications programs interfacing
with it.
To properly emulate the terminal, there must be a general way to
define and enter equivalents of those keys on non-IBM terminals.
This paper describes a method for doing this.
.FS
DLBA @(#)emhelp.txt	1.6 
.FE
.PP
The EM3277 package allows the system administrator or installer to
define a keyboard mapping arrangement for most ASCII asynchronous
terminals such that function keys available on that terminal may be
used to emulate other keys on the IBM terminal.
Definitions for those special keys must be placed in the 
.I /etc/termcap
file, a special terminal capability database which is also used to define
the asynchronous terminal's control sequences for cursor positioning,
highlighting data, and other special features.
.AE
.LP
.I /etc/termcap
is a database which decribes terminals by describing their capabilities and
how operations are performed on them.
It is used by screen editor
.I vi
and utility library
.I curses
to determine what various character sequences sent from a
terminal mean. Used with the
.I curses
library, it allows applications programs to be terminal-independent
but still invoke screen-oriented actions such as cursor positioning,
screen erasing, and highlighting.
.LP
.I Em3277
has a
.I help
function which examines
.I /etc/termcap
entries to display a map of the keys on a 
terminal which correspond to 3270 function keys.
When the user answers the question:
.DS
Would you like help? (Y/N):
.DE
.LP
with a lower- or upper-case 'y', the following keyboard map is displayed if
the proper
.I /etc/termcap
entries have been made:
.LP
.TS
center,box;
c s s s
c s s s
c s s s
l l|l l.
Terminal: <termtype>
The keyboard map for your terminal is as follows: 

3270 Name	[termtype] Key	3270 Name	[termtype] Key
_
RESET	[keyname]	PF7	[keyname]
ENTER	[keyname]	PF8	[keyname]
CLEAR	[keyname]	PF9	[keyname]
BACKTAB 	[keyname]	PF10	[keyname]
ERASE-EOF	[keyname]	PF11	[keyname]
ERASE-INP	[keyname]	PF12	[keyname]
INSERT	[keyname]	Shell cmd	[special key],![cmd]
DELETE	[keyname]	FM	[keyname]
PA1	[keyname]	DUP	[keyname]
PA2	[keyname]	Stats	[special key],s
PA3	[keyname]	Exit	[special key],q
PF1	[keyname]	TAB	[keyname]
PF2	[keyname]
PF3	[keyname]	Resetkey	[keyname]
PF4	[keyname]	Help Key	[keyname]
PF5	[keyname]	Stat Key	[keyname]
PF6	[keyname]	Printkey	[keyname]
.TE
.LP
The name of the terminal for which the map is made is substituted for
.I termtype.
The names of keys on that terminal which are used to perform the 3270 functions
listed are substituted for 
.I keyname.
.LP
The system administrator or installer must make entries in
.I /etc/termcap
defining the character sequence generated by the key being
mapped to perform a particular 3270 function,
and the name of the key which generates that sequence. If a
particular 3270 function isn't being used (no entry has been made for it
in
.I /etc/termcap),
"No Assignment" is displayed for the keyname. 
.LP
Sequence
entries in 
.I /etc/termcap
are noted and saved in a table by
.I em3277's
set up routine. When the sequence arrives at the terminal (the user presses
the key which generates the sequence)
.I em3277
looks it up in the table and matches it with the function to be performed.
Name entries in
.I /etc/termcap
are used by the 
.I em_help
routine to display the name of the key which, when pressed, will cause 
.I em3277
to perform the function. 
.LP
Sequence entries are made as follows:
.ID
S<i>=<sequence>
.DE
where
.I <i>
is a one-character index, 0-z, and 
.I <sequence>
is the sequence of characters generated by the key. 
.LP
Name entries are made as follows:
.ID
N<i>=<key name>
.DE
where
.I <i>
is a one-character index, 0-z, 
and
.I
<key name>
.R
is the name of the key which generates the sequence.
.LP
.I em_help
constructs key name labels and, using 
.I termcap
functions, retrieves them from the
.I termcap
database
.I (/etc/termcap).
.LP
3270 function keys should be defined as follows:
.LP
.TS
center,box;
l|c|l|c|l|c|l|c.
Termcap Name	Function	Label	Termcap Name	Function	Label
_
S0	RESET	N0	P5	PF5	Nf
S1	ENTER	N1	P6	PF6	Ng
S2	CLEAR	N2	P7	PF7	Nh
S3	BACKTAB	N3	P8	PF8	Nj
S4	ERASE_EOF	N4	P9	PF9	Nk
S5	ERASE_INP	N5	Pa	PF10	Nm
S6	INSERT	N6	Pb	PF11	Nn
S7	DELETE	N7	Pc	PF12	No
A1	PA1	N8	S0	Shell Command	Np
A2	PA2	N9	S9	FM	Nq
A3	PA3	Na	S8	DUP	Nr
P1	PF1	Nb	S0	Statistics	Ns
P2	PF2	Nc	S0	Exit	Nt
P3	PF3	Nd	tc	TAB	Nu
P4	PF4	Ne	SZ	Resetkey	NZ
SH	Helpkey	NH	ST	Statkey	NT
SP	Printkey	NP
.TE
.LP
To illustrate, let's say that your terminal's keyboard has some function
keys, F1 through F10, which you'd like to use as 3270 function keys
PF1 through PF10. By looking in the manual for your terminal, or by
using the
.I od(1)
utility, you've determined that F1 generates the sequence ESC?a, F2
generates ESC?b, F3 generates ESC?c, etc. So, using the above table,
you make entries in
.I /etc/termcap
for the key sequences as follows:
.IP
:P1=\\E?a:P2=\\E?b:P3=\\E?c:P4=\\E?d:....
.LP
Still using the above table, you make the name entries as follows:
.IP
:Nb=F1:Nc=F2:Nd=F3:Ne=F4:....
.LP
When you call on 
.I em_help
to print a keyboard map, it'll tell you that PF1 is F1, PF2 is F2, etc.
.LP
To illustrate further, suppose that there are Zentec Zephyr
terminals at your installation,
and you have determined that you'll use function keys labeled F1 through F12 for
3270 functions PF1 through PF12.
To use the keyboard map facility of the
.I em_help
module, you make entries in
.I /etc/termcap's
zephyr description as follows:
.LP
.DS
:Nb=F1:Nc=F2:Nd=F3:Ne=F4:Nf=F5:Ng=F6:Nh=F7:\\\\
:Nj=F8:Nk=F9:Nm=F10:Nn=F11:No=F12:
.DE
.LP
The following partial
.I /etc/termcap
entry for the Zentec Zephyr terminal should give you an idea as to how to
make key name entries:
.DS L
z1|zeph|zephyr|zentec zephyr:\\\\
	:N0=F16,r:N1=New Line:N2=Clear Page:N3=BACKTAB:N4=Line Delete:\\\\
	:N5=Line Clear:N6=INS:N7=DEL:N8=F13:N9=F14:Na=F15:\\\\
	:Nb=F1:Nc=F2:Nd=F3:Ne=F4:Nf=F5:Ng=F6:Nh=F7:Nj=F8:Nk=F9:Nm=F10:\\\\
	:Nn=F11:No=F12:Np=F16,!<cmd>:Ns=F16,s:Nt=F16,q:Nu=TAB:\\\\
	:Nq=Shift-F1:Nr=Shift-F2: ....
.DE
.LP
.bp
.LP
The
.I help
facility will produce the following keyboard map:
.TS
center,box;
c s s s
c s s s
c s s s
c c|c c
l l|l l.
Terminal: zentec zephyr
The keyboard map for your terminal is as follows:

3270 Name	zentec zephyr Key	3270 Name	zentec zephyr Key
_
RESET	F16,r	PF7	F7
ENTER	New Line	PF8	F8
CLEAR	Clear Page	PF9	F9
BACKTAB 	BACKTAB 	PF10	F10
ERASE-EOF	Delete Line	PF11	F11
ERASE-INP	Clear Line	PF12	F12
INSERT	INS	Shell cmd	F16,!<cmd>
DELETE	DEL	FM	Shift-F1
PA1	F13	DUP	Shift-F2
PA2	F14	Stats	F16,s
PA3	F15	Exit	F16,q
PF1	F1	TAB	TAB
PF2	F2	
PF3	F3	Resetkey	No Assignment
PF4	F4	Help Key	No Assignment
PF5	F5	Stat Key	No Assignment
PF6	F6	Printkey	No Assignment
.TE
.SH
SEE ALSO:
.DS
TERMCAP(5)
od(1)
.DE

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.