xref: /original-bsd/usr.bin/tn3270/ctlr/function.h (revision c3e32dec)
1 /*-
2  * Copyright (c) 1988, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)function.h	8.1 (Berkeley) 06/06/93
8  */
9 
10 /*
11  * The following are the various functions which the keyboard can ask
12  * the controller to perform.
13  *
14  * Note that this file (the following entries) are scanned by mkhit.c,
15  * and that the format must remain more-or-less consistent
16  * [ \t]*TOKEN
17  */
18 
19 enum ctlrfcn {
20 
21 	undefined = 0,			/* Not yet touched */
22 
23 	FCN_NULL,	  		/* Illegal sequence */
24 
25 	FCN_RESET,			/* unlock keyboard */
26 	FCN_MAKE_SHIFT_LOCK,
27 	FCN_BREAK_SHIFT_LOCK,
28 
29 	FCN_MAKE_SHIFT,			/* shift key pressed DOWN */
30 	FCN_BREAK_SHIFT,		/* shift key released */
31 
32 	FCN_MAKE_ALT,			/* alt key pressed DOWN */
33 	FCN_BREAK_ALT,			/* alt key released */
34 
35 	FCN_MAKE_CTRL,
36 
37 	FCN_CAPS_LOCK,
38 
39 	FCN_MONOCASE,			/* DISPLAY in upper case */
40 	FCN_DVCNL,
41 
42 	FCN_CHARACTER,			/* Not one of the following, but ... */
43 	FCN_VERTICAL_BAR,		/* EBCDIC solid vertical bar */
44 	FCN_CENTSIGN,			/* EBCDIC cent sign */
45 	FCN_SPACE,			/* EBCDIC space */
46 	FCN_DP,				/* EBCDIC dup character */
47 	FCN_FM,				/* EBCDIC field mark */
48 
49 	FCN_AID,			/* Some AID key */
50 	FCN_ATTN,
51 	FCN_CURSEL,			/* Cursor select function (and aid) */
52 	FCN_TEST,			/* Test function */
53 
54 	FCN_EINP,			/* erase input (dangerous) */
55 	FCN_EEOF,
56 	FCN_DELETE,
57 	FCN_INSRT,
58 	FCN_TAB,
59 	FCN_BTAB,
60 	FCN_NL,
61 	FCN_HOME,
62 	FCN_UP,
63 	FCN_DOWN,
64 	FCN_RIGHT,
65 	FCN_LEFT,
66 	FCN_LEFT2,
67 	FCN_RIGHT2,
68 
69 #if	!defined(PURE3274)
70 	/*
71 	 * Local editing functions
72 	 */
73 	FCN_SETTAB,			/* set a column tab */
74 	FCN_DELTAB,
75 	FCN_COLTAB,
76 	FCN_COLBAK,
77 	FCN_INDENT,			/* more margin over one col tab */
78 	FCN_UNDENT,
79 	FCN_SETMRG,
80 	FCN_SETHOM,
81 	FCN_CLRTAB,
82 	FCN_ERASE,			/* erase last character */
83 	FCN_WERASE,
84 	FCN_FERASE,
85 	FCN_WORDTAB,			/* tab to start of next word */
86 	FCN_WORDBACKTAB,
87 	FCN_WORDEND,			/* find next end of word */
88 	FCN_FIELDEND,			/* find next end of field */
89 
90 	/*
91 	 * APL functions
92 	 */
93 	FCN_APLON,			/* start using apl character set */
94 	FCN_APLOFF,
95 	FCN_APLEND,
96 
97 	FCN_PCON,
98 	FCN_PCOFF,
99 	FCN_INIT,			/* re-init screen */
100 	FCN_SYNCH,			/* synch up after line/control error */
101 	FCN_FLINP,			/* flush input buffer */
102 	FCN_RESHOW,			/* redraw screen */
103 	FCN_MASTER_RESET,		/* FLINP, RESET, RESHOW, + more */
104 
105 	FCN_DISC,			/* suspend application */
106 	FCN_ESCAPE,			/* enter command mode */
107 
108 	FCN_ALTK,			/* Dvorak keyboard */
109 
110 	FCN_XOFF,			/* suspend output to screen */
111 	FCN_XON,			/* resume output to screen */
112 
113 	FCN_LPRT			/* print screen on printer */
114 #endif	/* !defined(PURE3274) */
115 };
116 /*
117  * The following is the structure which defines what a 3270 keystroke
118  * can do.
119  */
120 
121 struct hits {
122     unsigned char keynumber;
123     struct hit {
124 	enum ctlrfcn ctlrfcn;
125 	unsigned char code;	/* AID value or 3270 display code */
126     } hit[4];	/* plain, shifted, alted, shiftalted */
127 };
128 
129 extern struct hits hits[];
130 
131 /*
132  * Definitions of the shift state (and the left/right shift key position).
133  */
134 
135 #define	SHIFT_RIGHT	0x20	/* Right shift key is down */
136 #define	SHIFT_LEFT	0x10	/* Left shift key is down */
137 #define	SHIFT_CONTROL	0x08	/* Control shift state (unused) */
138 #define	SHIFT_ALT	0x04	/* ALT shift state */
139 #define	SHIFT_CAPS	0x02	/* Caps lock state */
140 #define	SHIFT_UPSHIFT	0x01	/* Upshift state */
141