[comp.sys.sun] Mapping keys in SunView

rush%xanadu@lll-crg.llnl.gov.UUCP (Alan Edwards) (04/26/89)

In X-Sun-Spots-Digest: Volume 7, Issue 220, message 6 of 16
mcvax!cs.vu.nl!maart@uunet.uu.net (Maarten Litmaath) writes:
>
>versatc!todd@ames.arc.nasa.gov (Todd Scruggs) writes:
>\I am trying to map the function keys R1 - R15 to do macros in the VI
>\editor.
>
  [Maarten shows how to map charachters in vi with the 'map' command]

This is great.  I didn't realize that I could map the unused charachters
on the keyboard in vi until you pointed this out, now I am doing this a
lot.  Thanks Maarten.

But, it would be even more helpful if I could map unused keys (the L, F,
and R keys) in the SunView environment.  I figure that you should be able
to do this because SunView catches L5 and L7 and does special things with
them.  Does anyone know how to map these keys as macros in the SunView
windows environment?

Thanks, -Alan
 .------------------------------------. 
 | Alan Edwards: rush@xanadu.llnl.gov |
 |   or: rush%xanadu@lll-crg.llnl.gov |
 `------------------------------------'

chuck@trantor.harris-atd.com (Chuck Musciano) (05/09/89)

> But, it would be even more helpful if I could map unused keys (the L, F,
> and R keys) in the SunView environment.  I figure that you should be able
> to do this because SunView catches L5 and L7 and does special things with
> them.  Does anyone know how to map these keys as macros in the SunView
> windows environment?

You can create a file called .ttyswrc in your home directory which binds
character sequences to function keys.  Here is part of mine:

	mapi	L2	^Xe
	mapi	L3	^X(
	mapi	L4	^X)

	mapi	F1	\Ej
	mapi	F2	\E(
	mapi	F3	\E3

See the man page for shelltool for more info.  This bindings apply to any
tty window created in SunView.

Bug alert: If you create a .ttyswrc, you will change the way in which
function key events are delivered to event interposers on tty windows.  To
wit: if a function key has a .ttyswrc entry, the true function event
(shift F2, or whatever) will be delivered to your interposer.  If no
.ttyswrc entry exists, the ASCII escape sequence (ESC [ 2 0 3 z, or
whatever) is delivered instead.  For reliable handling of function events,
your programs should be able to parse and translate ASCII sequences into
function key events.  This is a gross bug in the notifier.  The latest
version of tooltool (available from either the sun-spots archives on
titan.rice.edu, or via anonymous ftp from trantor.harris-atd.com
(26.13.0.98) in /pub/suntools/tooltool) has a module called func_fix.c
which will perform function key translation for any interposer.

Chuck Musciano			ARPA  : chuck@trantor.harris-atd.com
Harris Corporation 		Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912		AT&T  : (407) 727-6131
Melbourne, FL 32902		FAX   : (407) 727-{5118,5227,4004}

[[ Secondary bug alert (this one in the documentation).  The manual page
for shelltool(1) refers to an on-line example ttyswrc file called
"/usr/lib/ttyswrc".  If you can find it on your 4.0.1 system, then you're
one up on me.  Our system doesn't have one.  --wnl ]]