xref: /csrg-svn/usr.bin/tn3270/ctlr/function.h (revision 62325)
148756Sbostic /*-
2*62325Sbostic  * Copyright (c) 1988, 1993
3*62325Sbostic  *	The Regents of the University of California.  All rights reserved.
433816Sbostic  *
548756Sbostic  * %sccs.include.redist.c%
633816Sbostic  *
7*62325Sbostic  *	@(#)function.h	8.1 (Berkeley) 06/06/93
833816Sbostic  */
933816Sbostic 
1033816Sbostic /*
1130076Sminshall  * The following are the various functions which the keyboard can ask
1230076Sminshall  * the controller to perform.
1330076Sminshall  *
1430076Sminshall  * Note that this file (the following entries) are scanned by mkhit.c,
1530076Sminshall  * and that the format must remain more-or-less consistent
1630076Sminshall  * [ \t]*TOKEN
1730076Sminshall  */
1830076Sminshall 
1930076Sminshall enum ctlrfcn {
2030076Sminshall 
2130076Sminshall 	undefined = 0,			/* Not yet touched */
2230076Sminshall 
2330076Sminshall 	FCN_NULL,	  		/* Illegal sequence */
2430076Sminshall 
2530076Sminshall 	FCN_RESET,			/* unlock keyboard */
2630665Sminshall 	FCN_MAKE_SHIFT_LOCK,
2730665Sminshall 	FCN_BREAK_SHIFT_LOCK,
2830076Sminshall 
2930076Sminshall 	FCN_MAKE_SHIFT,			/* shift key pressed DOWN */
3030076Sminshall 	FCN_BREAK_SHIFT,		/* shift key released */
3130076Sminshall 
3230076Sminshall 	FCN_MAKE_ALT,			/* alt key pressed DOWN */
3330076Sminshall 	FCN_BREAK_ALT,			/* alt key released */
3430076Sminshall 
3530076Sminshall 	FCN_MAKE_CTRL,
3630076Sminshall 
3731197Sminshall 	FCN_CAPS_LOCK,
3831197Sminshall 
3930076Sminshall 	FCN_MONOCASE,			/* DISPLAY in upper case */
4030076Sminshall 	FCN_DVCNL,
4130076Sminshall 
4230076Sminshall 	FCN_CHARACTER,			/* Not one of the following, but ... */
4330076Sminshall 	FCN_VERTICAL_BAR,		/* EBCDIC solid vertical bar */
4430076Sminshall 	FCN_CENTSIGN,			/* EBCDIC cent sign */
4530076Sminshall 	FCN_SPACE,			/* EBCDIC space */
4630076Sminshall 	FCN_DP,				/* EBCDIC dup character */
4730076Sminshall 	FCN_FM,				/* EBCDIC field mark */
4830076Sminshall 
4930076Sminshall 	FCN_AID,			/* Some AID key */
5030076Sminshall 	FCN_ATTN,
5130076Sminshall 	FCN_CURSEL,			/* Cursor select function (and aid) */
5230076Sminshall 	FCN_TEST,			/* Test function */
5330076Sminshall 
5430076Sminshall 	FCN_EINP,			/* erase input (dangerous) */
5530076Sminshall 	FCN_EEOF,
5630076Sminshall 	FCN_DELETE,
5730076Sminshall 	FCN_INSRT,
5830076Sminshall 	FCN_TAB,
5930076Sminshall 	FCN_BTAB,
6030076Sminshall 	FCN_NL,
6130076Sminshall 	FCN_HOME,
6230076Sminshall 	FCN_UP,
6330076Sminshall 	FCN_DOWN,
6430076Sminshall 	FCN_RIGHT,
6530076Sminshall 	FCN_LEFT,
6630076Sminshall 	FCN_LEFT2,
6730076Sminshall 	FCN_RIGHT2,
6830076Sminshall 
6930076Sminshall #if	!defined(PURE3274)
7030076Sminshall 	/*
7130076Sminshall 	 * Local editing functions
7230076Sminshall 	 */
7330076Sminshall 	FCN_SETTAB,			/* set a column tab */
7430076Sminshall 	FCN_DELTAB,
7530076Sminshall 	FCN_COLTAB,
7630076Sminshall 	FCN_COLBAK,
7730076Sminshall 	FCN_INDENT,			/* more margin over one col tab */
7830076Sminshall 	FCN_UNDENT,
7930076Sminshall 	FCN_SETMRG,
8030076Sminshall 	FCN_SETHOM,
8130076Sminshall 	FCN_CLRTAB,
8230076Sminshall 	FCN_ERASE,			/* erase last character */
8330076Sminshall 	FCN_WERASE,
8430076Sminshall 	FCN_FERASE,
8530076Sminshall 	FCN_WORDTAB,			/* tab to start of next word */
8630076Sminshall 	FCN_WORDBACKTAB,
8730076Sminshall 	FCN_WORDEND,			/* find next end of word */
8830076Sminshall 	FCN_FIELDEND,			/* find next end of field */
8930076Sminshall 
9030076Sminshall 	/*
9130076Sminshall 	 * APL functions
9230076Sminshall 	 */
9330076Sminshall 	FCN_APLON,			/* start using apl character set */
9430076Sminshall 	FCN_APLOFF,
9530076Sminshall 	FCN_APLEND,
9630076Sminshall 
9730076Sminshall 	FCN_PCON,
9830076Sminshall 	FCN_PCOFF,
9930076Sminshall 	FCN_INIT,			/* re-init screen */
10030076Sminshall 	FCN_SYNCH,			/* synch up after line/control error */
10130076Sminshall 	FCN_FLINP,			/* flush input buffer */
10230076Sminshall 	FCN_RESHOW,			/* redraw screen */
10330076Sminshall 	FCN_MASTER_RESET,		/* FLINP, RESET, RESHOW, + more */
10430076Sminshall 
10530076Sminshall 	FCN_DISC,			/* suspend application */
10630076Sminshall 	FCN_ESCAPE,			/* enter command mode */
10730076Sminshall 
10830076Sminshall 	FCN_ALTK,			/* Dvorak keyboard */
10930076Sminshall 
11030076Sminshall 	FCN_XOFF,			/* suspend output to screen */
11130076Sminshall 	FCN_XON,			/* resume output to screen */
11230076Sminshall 
11330076Sminshall 	FCN_LPRT			/* print screen on printer */
11430076Sminshall #endif	/* !defined(PURE3274) */
11530076Sminshall };
11630076Sminshall /*
11730021Sminshall  * The following is the structure which defines what a 3270 keystroke
11830021Sminshall  * can do.
11930021Sminshall  */
12030021Sminshall 
12130021Sminshall struct hits {
12230021Sminshall     unsigned char keynumber;
12330021Sminshall     struct hit {
12430076Sminshall 	enum ctlrfcn ctlrfcn;
12530076Sminshall 	unsigned char code;	/* AID value or 3270 display code */
12630021Sminshall     } hit[4];	/* plain, shifted, alted, shiftalted */
12730021Sminshall };
12830021Sminshall 
12930021Sminshall extern struct hits hits[];
13031197Sminshall 
13131197Sminshall /*
13231197Sminshall  * Definitions of the shift state (and the left/right shift key position).
13331197Sminshall  */
13431197Sminshall 
13531197Sminshall #define	SHIFT_RIGHT	0x20	/* Right shift key is down */
13631197Sminshall #define	SHIFT_LEFT	0x10	/* Left shift key is down */
13731197Sminshall #define	SHIFT_CONTROL	0x08	/* Control shift state (unused) */
13831197Sminshall #define	SHIFT_ALT	0x04	/* ALT shift state */
13931197Sminshall #define	SHIFT_CAPS	0x02	/* Caps lock state */
14031197Sminshall #define	SHIFT_UPSHIFT	0x01	/* Upshift state */
141