From: leichter@lrw.com (Jerry Leichter)
Newsgroups: comp.os.vms
Subject: Re: How to obtain X button press info from character cell appli
Date: 25 Aug 92 01:37:51 GMT
Distribution: world
Organization: The Internet


	>>How does one receive notification of and information relating to a
	>>pointing device button press event within a DECterm?  From a
	>>character cell oriented application, I'd like to translate such an
	>>event to the appropriate character cell, much as EVE is capable of
	>>doing.
	> 
	> This may or may not be a definitive answer.  I have noticed that EVE
	> responds to mouse-button clicks for cursor positioning even in a
	> "LAT Terminal Window," on my VT1200, which is NOT part of a 
	> DECwindows session. I have ascertained that EVE accomplishes this
	> feat by understanding an escape sequence generated by the VT1200 
	> when the mouse button is pressed. My intuition tells me that in a
	> DECterm window, which like my LAT Terminal Window, "acts like a non-
	> DECwindows terminal," probably operates the same way: i.e., the 
	> DECterm emulator probably generates the same escape sequence(s).
	> 
	Another piece of info is that SMG apparently can do it as well. I have
	here an application written using standard SMG calls (in particular
	SMG$SELECT_FROM_MENU) - much to my surprise (and delight...) I
	discovered that in DECterm I can point the mouse to a menu item and
	click the button and the application sees it as moving to that menu
	item and pressing return.  This works even when the DECterm is running
	on another machine than the application (and even if the other machine
	is a DECstation/ULTRIX). Therefore I also suspect that some escape
	sequences are involved. BTW: anybody knows what does a VT-340 with a
	mouse send to the host? Could it be the same sequence?

Amazing.  Three levels of discussion, and we are still in the realm of
guesses, surmises and observation of what other programs do.  Has anyone
considered the ridiculous alternative of CHECKING THE DOCUMENTATION?  And, no,
that does NOT mean querying thousands of people on the net to see if someone
happens to have the documentation and is willing to spend the time to look it
up for you.

For what it's worth:  On the real VT330/VT340, the mouse (or other locator
device) is NOT accessible from text mode.  However, it CAN be accessed from
ReGIS mode.  It's possible to enter and leave ReGIS mode without disturbing
the displayed text.  Since the correspondence between the text mode and ReGIS
mode coordinates is fixed on any given terminal type (although not in any way
"supported", in the sense that it can vary from terminal type to terminal
type), it is the famous "Small Matter of Programming" to translate from ReGIS
coordinates to text position.  I will not try to explain how to go about using
ReGIS to read the mouse position; it's too complex.  See the documentation.

A text-mode-mouse interface was defined and was supposed to be in the VT330,
but was dropped (because of a mix of lack of code space and time constraints.
Interesting fact:  There is more code in the firmware of a VT330 terminal than
there was in the entire Unix V6 operating system.)  I haven't kept up with
what's been implemented where since then.  It is quite possible that DECterms
implement this interface; for that matter, VT330+'s might, too.  Again, the
right way to find out is to read the documentation.

							-- Jerry

Xref: sparky comp.os.vms:14291 vmsnet.sources.d:565