xref: /csrg-svn/usr.bin/tn3270/ctlr/function.h (revision 31197)
130021Sminshall /*
230076Sminshall  * The following are the various functions which the keyboard can ask
330076Sminshall  * the controller to perform.
430076Sminshall  *
530076Sminshall  * Note that this file (the following entries) are scanned by mkhit.c,
630076Sminshall  * and that the format must remain more-or-less consistent
730076Sminshall  * [ \t]*TOKEN
830076Sminshall  */
930076Sminshall 
1030076Sminshall enum ctlrfcn {
1130076Sminshall 
1230076Sminshall 	undefined = 0,			/* Not yet touched */
1330076Sminshall 
1430076Sminshall 	FCN_NULL,	  		/* Illegal sequence */
1530076Sminshall 
1630076Sminshall 	FCN_RESET,			/* unlock keyboard */
1730665Sminshall 	FCN_MAKE_SHIFT_LOCK,
1830665Sminshall 	FCN_BREAK_SHIFT_LOCK,
1930076Sminshall 
2030076Sminshall 	FCN_MAKE_SHIFT,			/* shift key pressed DOWN */
2130076Sminshall 	FCN_BREAK_SHIFT,		/* shift key released */
2230076Sminshall 
2330076Sminshall 	FCN_MAKE_ALT,			/* alt key pressed DOWN */
2430076Sminshall 	FCN_BREAK_ALT,			/* alt key released */
2530076Sminshall 
2630076Sminshall 	FCN_MAKE_CTRL,
2730076Sminshall 
28*31197Sminshall 	FCN_CAPS_LOCK,
29*31197Sminshall 
3030076Sminshall 	FCN_MONOCASE,			/* DISPLAY in upper case */
3130076Sminshall 	FCN_DVCNL,
3230076Sminshall 
3330076Sminshall 	FCN_CHARACTER,			/* Not one of the following, but ... */
3430076Sminshall 	FCN_VERTICAL_BAR,		/* EBCDIC solid vertical bar */
3530076Sminshall 	FCN_CENTSIGN,			/* EBCDIC cent sign */
3630076Sminshall 	FCN_SPACE,			/* EBCDIC space */
3730076Sminshall 	FCN_DP,				/* EBCDIC dup character */
3830076Sminshall 	FCN_FM,				/* EBCDIC field mark */
3930076Sminshall 
4030076Sminshall 	FCN_AID,			/* Some AID key */
4130076Sminshall 	FCN_ATTN,
4230076Sminshall 	FCN_CURSEL,			/* Cursor select function (and aid) */
4330076Sminshall 	FCN_TEST,			/* Test function */
4430076Sminshall 
4530076Sminshall 	FCN_EINP,			/* erase input (dangerous) */
4630076Sminshall 	FCN_EEOF,
4730076Sminshall 	FCN_DELETE,
4830076Sminshall 	FCN_INSRT,
4930076Sminshall 	FCN_TAB,
5030076Sminshall 	FCN_BTAB,
5130076Sminshall 	FCN_NL,
5230076Sminshall 	FCN_HOME,
5330076Sminshall 	FCN_UP,
5430076Sminshall 	FCN_DOWN,
5530076Sminshall 	FCN_RIGHT,
5630076Sminshall 	FCN_LEFT,
5730076Sminshall 	FCN_LEFT2,
5830076Sminshall 	FCN_RIGHT2,
5930076Sminshall 
6030076Sminshall #if	!defined(PURE3274)
6130076Sminshall 	/*
6230076Sminshall 	 * Local editing functions
6330076Sminshall 	 */
6430076Sminshall 	FCN_SETTAB,			/* set a column tab */
6530076Sminshall 	FCN_DELTAB,
6630076Sminshall 	FCN_COLTAB,
6730076Sminshall 	FCN_COLBAK,
6830076Sminshall 	FCN_INDENT,			/* more margin over one col tab */
6930076Sminshall 	FCN_UNDENT,
7030076Sminshall 	FCN_SETMRG,
7130076Sminshall 	FCN_SETHOM,
7230076Sminshall 	FCN_CLRTAB,
7330076Sminshall 	FCN_ERASE,			/* erase last character */
7430076Sminshall 	FCN_WERASE,
7530076Sminshall 	FCN_FERASE,
7630076Sminshall 	FCN_WORDTAB,			/* tab to start of next word */
7730076Sminshall 	FCN_WORDBACKTAB,
7830076Sminshall 	FCN_WORDEND,			/* find next end of word */
7930076Sminshall 	FCN_FIELDEND,			/* find next end of field */
8030076Sminshall 
8130076Sminshall 	/*
8230076Sminshall 	 * APL functions
8330076Sminshall 	 */
8430076Sminshall 	FCN_APLON,			/* start using apl character set */
8530076Sminshall 	FCN_APLOFF,
8630076Sminshall 	FCN_APLEND,
8730076Sminshall 
8830076Sminshall 	FCN_PCON,
8930076Sminshall 	FCN_PCOFF,
9030076Sminshall 	FCN_INIT,			/* re-init screen */
9130076Sminshall 	FCN_SYNCH,			/* synch up after line/control error */
9230076Sminshall 	FCN_FLINP,			/* flush input buffer */
9330076Sminshall 	FCN_RESHOW,			/* redraw screen */
9430076Sminshall 	FCN_MASTER_RESET,		/* FLINP, RESET, RESHOW, + more */
9530076Sminshall 
9630076Sminshall 	FCN_DISC,			/* suspend application */
9730076Sminshall 	FCN_ESCAPE,			/* enter command mode */
9830076Sminshall 
9930076Sminshall 	FCN_ALTK,			/* Dvorak keyboard */
10030076Sminshall 
10130076Sminshall 	FCN_XOFF,			/* suspend output to screen */
10230076Sminshall 	FCN_XON,			/* resume output to screen */
10330076Sminshall 
10430076Sminshall 	FCN_LPRT			/* print screen on printer */
10530076Sminshall #endif	/* !defined(PURE3274) */
10630076Sminshall };
10730076Sminshall /*
10830021Sminshall  * The following is the structure which defines what a 3270 keystroke
10930021Sminshall  * can do.
11030021Sminshall  */
11130021Sminshall 
11230021Sminshall struct hits {
11330021Sminshall     unsigned char keynumber;
11430021Sminshall     struct hit {
11530076Sminshall 	enum ctlrfcn ctlrfcn;
11630076Sminshall 	unsigned char code;	/* AID value or 3270 display code */
11730021Sminshall     } hit[4];	/* plain, shifted, alted, shiftalted */
11830021Sminshall };
11930021Sminshall 
12030021Sminshall extern struct hits hits[];
121*31197Sminshall 
122*31197Sminshall /*
123*31197Sminshall  * Definitions of the shift state (and the left/right shift key position).
124*31197Sminshall  */
125*31197Sminshall 
126*31197Sminshall #define	SHIFT_RIGHT	0x20	/* Right shift key is down */
127*31197Sminshall #define	SHIFT_LEFT	0x10	/* Left shift key is down */
128*31197Sminshall #define	SHIFT_CONTROL	0x08	/* Control shift state (unused) */
129*31197Sminshall #define	SHIFT_ALT	0x04	/* ALT shift state */
130*31197Sminshall #define	SHIFT_CAPS	0x02	/* Caps lock state */
131*31197Sminshall #define	SHIFT_UPSHIFT	0x01	/* Upshift state */
132