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