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