From: perl@dwrsun4.UUCP (Robert Perlberg)
Newsgroups: comp.databases.ingres
Subject: Re: Question on INgres and Openwin
Date: 22 Dec 92 22:14:25 GMT
Organization: Dean Witter Reynolds Inc., New York

While this might be overkill for some, I am very picky about such
things, so I wrote my own termcap entries and mapping files and did
some keyboard remapping to get it to work the way I wanted.

The following should be added to the $II_SYSTEM/ingres/files/termcap
file:

::: START :::
s4|xterm-sun-t4|XTerm under OpenWindows on Sun with Type 4 keyboard:\
	:wg=\E7\E[r\E[999;999H\E[6n\E8:wr=\E[%d;%dR:\
	:bs:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:nd=\E[C:\
	:is=\E(B^O\E[?7h\E[?1l\E>:rv=\E[7m:bl=\E[7m:bo=\E[1m:us=\E[4m:ea=\E[m:\
	:za=\E[1;4;7m:zb=\E[1;4m:zc=\E[1;7m:zd=\E[1;7m:ze=\E[4;7m:zf=\E[4;7m:\
	:zg=\E[7m:zh=\E[1;4;7m:zi=\E[4;7m:zj=\E[1;7m:zk=\E[1;4;7m:ld=:\
	:ls=\E)0^N:le=\E(B^O:qa=j:qb=k:qc=l:qd=m:qe=n:qf=q:qg=t:qh=u:qi=v:\
	:qj=w:qk=x:kn#25:ky:k0=\E[224z:k1=\E[225z:k2=\E[226z:k3=\E[227z:\
	:k4=\E[228z:k5=\E[229z:k6=\E[230z:k7=\E[231z:k8=\E[232z:k9=\E[233z:\
	:kA=\E[234z:kB=\E[235z:kC=\E[208z:kD=\E[210z:kE=\E[211z:kF=\E[212z:\
	:kG=\E[213z:kH=\E[214z:kI=\E[216z:kJ=\E[218z:kK=\E[220z:kL=\E[222z:\
	:kM=\E[2z:kN=\E[249z:kO=\E[250z:\
	:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:do=\E[B:sr=\EM:\
	:cs=\E[%d;%dr:sf=\n:te=\E(B^O\E[?7h\E[?1l\E>:ti=\E(B^O\E[?7h\E[?1l\E>:\
	:ke=\E(B^O\E[?7h\E[?1l\E>:ks=\E(B^O\E[?7h\E[?1l\E>:\
	:mf=xterm-sun-t4.map:
::: END :::

Note that you have to set your TERM_INGRES to "xterm-sun-t4", or else
change the name of the above termcap entry to whatever you like.

Put the following into a file called
$II_SYSTEM/ingres/files/xterm-sun-t4.map:

::: START :::
/* DWR FRS Mapping file for xterm-sun-t4 */

/* Menu Key */
	menu = pf13 (R1)

	nextfield = controlI (Tab)

	previousfield = controlP (^P)

	nextword = controlU (^U)

	previousword = controlR (^R)

/* Switch between insert and overstrike */	
	mode = PF23 (Ins)

	redraw = controlW (^W)

/* Remove character under cursor */
	deletechar = pf24 (Del)

	rubout = controlDEL (Delete)

	editor = controlV (^V)

	/* leftchar = */

	/* rightchar = */

	/* downline = */

	/* upline = */
	controlK = off
	controlJ = off

	newrow = controlN (^N)

/* Clear the field */
	clear = controlB (^B)

	clearrest = controlX (^X)

/* Previous screen or set of rows in table field */
	scrolldown = pf19 (PgUp)

/* Next screen or set of rows in table field */
	scrollup = pf22 (PgDn)

/* Scroll page or form left */
	scrollleft = controlL (^L)

/* Scroll page or form right */
	scrollright = controlH (^H)

	duplicate = controlA (^A)

/* Print contents of current screen to file or printer */
	printscreen = controlG (^G)

	nextitem = controlM (Return)

/* Select first menu item */
	menuitem1 = pf1 (F1)

/* Select second menu item */
	menuitem2 = pf2 (F2)

/* Select third menu item */
	menuitem3 = pf3 (F3)

/* Select fourth menu item */
	menuitem4 = pf4 (F4)

/* Select fifth menu item */
	menuitem5 = pf5 (F5)

/* Select sixth menu item */
	menuitem6 = pf6 (F6)

/* Select seventh menu item */
	menuitem7 = pf7 (F7)

/* Select eighth menu item */
	menuitem8 = pf8 (F8)

/* Select nineth menu item */
	menuitem9 = pf9 (F9)

/* Help facility */
	frskey1 = pf11 (F11)

/* Quit from program */
	frskey2	= pf15 (R4)

/* End current screen and return to previous screen */
	frskey3	= pf14 (R3)

/* Go or execute function */
	frskey4 = pf25 (Enter)

/* toggle active flag or Put cursor on top of form or table field */
	frskey5 = pf18 (Home)

/* Put cursor on bottom of form or table field */
	frskey6	= pf21 (End)

/* Find next occurrence of string in this column of table field */
	frskey7	= pf10 (F10)

/* Save Function */
	frskey8 = pf16 (R5)

/* Undo and Forget Function */
	frskey9 = pf17 (R6)

/* Bring up List Choices */
	frskey10 = pf12 (F12)
::: END :::

The following needs to be added to the file
$OPENWINHOME/lib/XKeysymDB:

::: START :::
KP_Del:				FFFE
::: END :::

You may have to restart OpenWindows for that to take effect.

Finally, invoke xterm with the following command (I have this in a
shell script, of course):

xterm -sf -xrm \
	'XTerm*VT100.Translations: #override \
		<Key>L6:select-set(CLIPBOARD)\n\
		<Key>L8:insert-selection(CLIPBOARD) \n\
		<Key>SunXK_F36: string(0x1b) string("[234z") \n\
		<Key>SunXK_F37: string(0x1b) string("[235z") \n\
		<Key>apXK_Read: string(0x1b) string("[234z") \n\
		<Key>apXK_Edit: string(0x1b) string("[235z") \n\
		<Key>KP_Del: string(0x1b) string("[249z") \n\
		<Key>KP_Enter: string(0x1b) string("[250z")'

Note that this is all under OpenWindows 3.0 under SunOS 4.1.2 with at
Type-4 keyboard.  I can't vouch for any other configurations.

BTW, does Ingres have any intentions of fixing wview to work under
OpenWindows, or is the problem in OpenWindows, and if so, does Sun have
any intention of fixing it?

Robert Perlberg
Dean Witter Reynolds Inc., New York
dwrsun4!perl@murphy.com -or- philabs!dwrsun4!perl

"We don't believe the software industry is ripping off the customer."
	-- Ken Wasch, executive director of the Software Publishers Association
Newsgroups: comp.databases.ingres