/* $Header: /usr3/Src/emu/tdesc/RCS/vt220-auxTrans,v 1.4 91/09/30 18:15:20 me Exp $ */

/*
 * Copyright 1990 by PCS Computer Systeme, GmbH. Munich, West Germany.
 *
 *                        All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software and its 
 * documentation for any purpose and without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in 
 * supporting documentation, and that the names of PCS or the authors not
 * be used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.  
 * 
 * PCS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 * PCS, THE AUTHORS, OR THEIR HOUSEPETS BE LIABLE FOR ANY SPECIAL, INDIRECT
 * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THIS SOFTWARE. SO DON'T SUE US. THANK YOU.
 *
 */

/*
 * Auxilliary keyboard translation definitions for the emu "vt220" terminal.
 *
 * Author: Michael Elbel, Jordan Hubbard and Tom Bagli
 * Date: June 28th, 1990
 * Description: This file contains translations for various different
 *		keyboard settings a vt220 might have.
 *
 * Revision History:
 *
 * $Log:	vt220-auxTrans,v $
# Revision 1.4  91/09/30  18:15:20  me
# *** empty log message ***
# 
# Revision 1.3  91/09/25  14:35:41  jkh
# *** empty log message ***
# 
# Revision 1.2  91/09/24  18:09:54  me
# yes
# 
# Revision 1.1  91/08/17  10:12:19  jkh
# Initial revision
# 
 *
 */

/* Application Keypad */
*term.vt220-auxTrans-appKeypad:						\
	/* Group 1 */							\
	:<Key>KP_0:	key-input("Op")\n				\
	:<Key>KP_1:	key-input("Oq")\n				\
	:<Key>KP_2:	key-input("Or")\n				\
	:<Key>KP_3:	key-input("Os")\n				\
	:<Key>KP_4:	key-input("Ot")\n				\
	:<Key>KP_5:	key-input("Ou")\n				\
	:<Key>KP_6:	key-input("Ov")\n				\
	:<Key>KP_7:	key-input("Ow")\n				\
	:<Key>KP_8:	key-input("Ox")\n				\
	:<Key>KP_9:	key-input("Oy")\n				\
	/* Group 2 */							\
	:<Key>KP_Decimal: key-input("On")\n				\
	:<Key>KP_Subtract: key-input("Om")\n				\
	:<Key>KP_Separator: key-input("Ol")\n				\
	:<Key>KP_Enter:	key-input("OM")\n				\

/* Numeric Keypad */
*term.vt220-auxTrans-numKeypad:						\
	/* Group 1 */							\
	:<Key>KP_0:	key-input("0")\n				\
	:<Key>KP_1:	key-input("1")\n				\
	:<Key>KP_2:	key-input("2")\n				\
	:<Key>KP_3:	key-input("3")\n				\
	:<Key>KP_4:	key-input("4")\n				\
	:<Key>KP_5:	key-input("5")\n				\
	:<Key>KP_6:	key-input("6")\n				\
	:<Key>KP_7:	key-input("7")\n				\
	:<Key>KP_8:	key-input("8")\n				\
	:<Key>KP_9:	key-input("9")\n				\
	/* Group 2 */							\
	:<Key>KP_Decimal: key-input(".")\n				\
	:<Key>KP_Subtract: key-input("-")\n				\
	:<Key>KP_Separator: key-input(",")\n				\
	:<Key>KP_Enter:	key-input("\r")\n				\

/* Application Cursor Keys */
*term.vt220-auxTrans-appCKeys:						\
	~Shift <Key>Left:	key-input("OD")\n			\
	~Shift <Key>Right:	key-input("OC")\n			\
	~Shift <Key>Down:	key-input("OB")\n			\
	~Shift <Key>Up:		key-input("OA")\n			\
	
/* Normal Cursor Keys */
*term.vt220-auxTrans-normCKeys:						\
	~Shift <Key>Left:	key-input("[D")\n			\
	~Shift <Key>Right:	key-input("[C")\n			\
	~Shift <Key>Down:	key-input("[B")\n			\
	~Shift <Key>Up:		key-input("[A")\n			\

/* Function Keys */
*term.vt220-auxTrans-fkeys:						\
	:<Key>F1:	key-input("[11~")\n				\
	:<Key>F2:	key-input("[12~")\n				\
	:<Key>F3:	key-input("[13~")\n				\
	:<Key>F4:	key-input("[14~")\n				\
	:<Key>F5:	key-input("[15~")\n				\
	:<Key>F6:	key-input("[17~")\n				\
	:<Key>F7:	key-input("[18~")\n				\
	:<Key>F8:	key-input("[19~")\n				\
	:<Key>F9:	key-input("[20~")\n				\
	:<Key>F10:	key-input("[21~")\n				\
	:<Key>F11:	key-input("[23~")\n				\
	:<Key>F12:	key-input("[24~")\n				\
	:<Key>F13:	key-input("[25~")\n				\
	:<Key>F14:	key-input("[26~")\n				\
	:<Key>F15:	key-input("[28~")\n				\
	:<Key>F16:	key-input("[29~")\n				\
	:<Key>F17:	key-input("[31~")\n				\
	:<Key>F18:	key-input("[32~")\n				\
	:<Key>F19:	key-input("[33~")\n				\
	:<Key>F20:	key-input("[34~")\n				\

/* Misc. Function Keys (the ones above the cursor keys) */
*term.vt220-auxTrans-miscFkeys:						\
	~Shift <Key>Find:	key-input("[1~")\n			\
	~Shift <Key>Insert:	key-input("[2~")\n			\
	~Shift <Key>Cancel:	key-input("[3~")\n			\
	~Shift <Key>Select:	key-input("[4~")\n			\
	~Shift <Key>Prior:	key-input("[5~")\n			\
	~Shift <Key>Next:	key-input("[6~")\n			\

/*
 * redefine Multi_key to the keysym of the key you're using as Compose Key.
 * This is only necessary if your keyboard doesn't kave a key that 
 * generates Multi_key and you don't want to use xmodmap to make one
 */
/* #define Multi_key Alt_L */

/* Umlaute on braces and so on */
*term.vt220-auxTrans-multiKeys:						  \
  ~Shift Mod1<Key>bracketleft:	call-parser(ROP_INSERT_CHAR, "", A, 228)\n\
  Shift Mod1<Key>bracketleft:	call-parser(ROP_INSERT_CHAR, "", A, 196)\n\
  ~Shift Mod1<Key>bracketright:	call-parser(ROP_INSERT_CHAR, "", A, 252)\n\
  Shift Mod1<Key>bracketright:	call-parser(ROP_INSERT_CHAR, "", A, 220)\n\
  ~Shift Mod1<Key>backslash:	call-parser(ROP_INSERT_CHAR, "", A, 246)\n\
  Shift Mod1<Key>backslash:	call-parser(ROP_INSERT_CHAR, "", A, 214)\n\
  ~Shift Mod1<Key>grave:	call-parser(ROP_INSERT_CHAR, "", A, 223)\n\
  Shift Mod1<Key>grave:		call-parser(ROP_INSERT_CHAR, "", A, 167)\n\

/* Compose-Generated Characters */
#define CCHAR(first, second, result) <Key>Multi_key,:<Key>first,:<Key>second:\
	call-parser(ROP_INSERT_CHAR, "", A, result) \n

*term.vt220-auxTrans-composeKeys:					\
CCHAR(plus, plus, 35)			CCHAR(a, a, 64)			\
CCHAR(A, A, 64)				CCHAR(parenleft, parenleft, 91)	\
CCHAR(slash, slash, 92)			CCHAR(slash, less, 92)		\
CCHAR(parenright, parenright, 93)	CCHAR(parenleft, minus, 123)	\
CCHAR(slash, asciicircum, 124)		CCHAR(parenright, minus, 125)	\
CCHAR(exclam, exclam, 161)		CCHAR(c, slash, 162)		\
CCHAR(c, bar, 162)			CCHAR(C, slash, 162)		\
CCHAR(C, bar, 162)			CCHAR(L, minus, 163)		\
CCHAR(l, minus, 163)			CCHAR(L, equal, 163)		\
CCHAR(l, equal, 163)			CCHAR(y, equal, 165)		\
CCHAR(y, minus, 165)			CCHAR(Y, equal, 165)		\
CCHAR(Y, minus, 165)			CCHAR(s, o, 167)		\
CCHAR(s, exclam, 167)			CCHAR(s, 0, 167)		\
CCHAR(S, O, 167)			CCHAR(S, exclam, 167)		\
CCHAR(S, 0, 167)			CCHAR(c, O, 169)		\
CCHAR(C, O, 169)			CCHAR(c, 0, 169)		\
CCHAR(C, 0, 169)			CCHAR(a, underscore, 170)	\
CCHAR(A, underscore, 170)		CCHAR(less, less, 171)		\
CCHAR(0, asciicircum, 176)		CCHAR(space, asterisk, 176)	\
CCHAR(space, o, 176)			CCHAR(plus, minus, 177)		\
CCHAR(2, asciicircum, 178)		CCHAR(3, asciicircum, 179)	\
CCHAR(slash, u, 181)			CCHAR(slash, U, 181)		\
CCHAR(p, exclam, 182)			CCHAR(P, exclam, 182)		\
CCHAR(period, asciicircum, 183)		CCHAR(1, asciicircum, 185)	\
CCHAR(o, underscore, 186)		CCHAR(O, underscore, 186)	\
CCHAR(greater, greater, 187)		CCHAR(1, 4, 188)		\
CCHAR(1, 2, 189)			CCHAR(question, question, 191)	\
CCHAR(A, grave, 192)			CCHAR(A, quoteright, 193)	\
CCHAR(A, asciicircum, 194)		CCHAR(A, asciitilde, 195)	\
CCHAR(A, quotedbl, 196)			CCHAR(A, asterisk, 197)		\
CCHAR(A, E, 198)			CCHAR(C, comma, 199)		\
CCHAR(E, grave, 200)			CCHAR(E, quoteright, 201)	\
CCHAR(E, asciicircum, 202)		CCHAR(E, quotedbl, 203)		\
CCHAR(I, grave, 204)			CCHAR(I, quoteright, 205)	\
CCHAR(I, asciicircum, 206)		CCHAR(I, quotedbl, 207)		\
CCHAR(N, asciitilde, 209)		CCHAR(O, grave, 210)		\
CCHAR(O, quoteright, 211)		CCHAR(O, asciicircum, 212)	\
CCHAR(O, asciitilde, 213)		CCHAR(O, quotedbl, 214)		\
CCHAR(O, slash, 216)			CCHAR(U, grave, 217)		\
CCHAR(U, quoteright, 218)		CCHAR(U, asciicircum, 219)	\
CCHAR(U, quotedbl, 220)			CCHAR(Y, quotedbl, 221)		\
CCHAR(s, s, 223)			CCHAR(a, grave, 224)		\
CCHAR(a, quoteright, 225)		CCHAR(a, asciicircum, 226)	\
CCHAR(a, asciitilde, 227)		CCHAR(a, quotedbl, 228)		\
CCHAR(a, asterisk, 229)			CCHAR(a, e, 230)		\
CCHAR(c, comma, 231)			CCHAR(e, grave, 232)		\
CCHAR(e, quoteright, 233)		CCHAR(e, asciicircum, 234)	\
CCHAR(e, quotedbl, 235)			CCHAR(i, grave, 236)		\
CCHAR(i, quoteright, 237)		CCHAR(i, asciicircum, 238)	\
CCHAR(i, quotedbl, 239)			CCHAR(n, asciitilde, 241)	\
CCHAR(o, grave, 242)			CCHAR(o, quoteright, 243)	\
CCHAR(o, asciicircum, 244)		CCHAR(o, asciitilde, 245)	\
CCHAR(o, quotedbl, 246)			CCHAR(o, slash, 248)		\
CCHAR(u, grave, 249)			CCHAR(u, quoteright, 250)	\
CCHAR(u, asciicircum, 251)		CCHAR(u, quotedbl, 252)		\
CCHAR(y, quotedbl, 253)							\
/* The keys used in Compose Sequences (so we get them again)     */	\
/* This is necessary to work around a bug in the X toolkit (boo) */	\
:<Key>A:		key-input()\n	:<Key>C:		key-input()\n\
:<Key>E:		key-input()\n	:<Key>I:		key-input()\n\
:<Key>L:		key-input()\n	:<Key>N:		key-input()\n\
:<Key>O:		key-input()\n	:<Key>P:		key-input()\n\
:<Key>S:		key-input()\n	:<Key>U:		key-input()\n\
:<Key>Y:		key-input()\n	:<Key>a:		key-input()\n\
:<Key>c:		key-input()\n	:<Key>e:		key-input()\n\
:<Key>i:		key-input()\n	:<Key>l:		key-input()\n\
:<Key>n:		key-input()\n	:<Key>o:		key-input()\n\
:<Key>p:		key-input()\n	:<Key>s:		key-input()\n\
:<Key>u:		key-input()\n	:<Key>y:		key-input()\n\
:<Key>0:		key-input()\n	:<Key>1:		key-input()\n\
:<Key>2:		key-input()\n	:<Key>3:		key-input()\n\
:<Key>4:		key-input()\n	:<Key>space:		key-input()\n\
:<Key>plus:		key-input()\n	:<Key>minus:		key-input()\n\
:<Key>parenleft:	key-input()\n	:<Key>parenright:	key-input()\n\
:<Key>slash:		key-input()\n	:<Key>less:		key-input()\n\
:<Key>greater:		key-input()\n	:<Key>equal:		key-input()\n\
:<Key>exclam:		key-input()\n	:<Key>question:		key-input()\n\
:<Key>underscore:	key-input()\n	:<Key>bar:		key-input()\n\
:<Key>asterisk:		key-input()\n	:<Key>period:		key-input()\n\
:<Key>comma:		key-input()\n	:<Key>grave:		key-input()\n\
:<Key>quotedbl:		key-input()\n	:<Key>quoteright:	key-input()\n\
:<Key>asciicircum:	key-input()\n	:<Key>asciitilde:	key-input()\n
