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