🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.tpu
Article #53

Re: How to obtain X button press info from character cell

#53
From: bill ZK2-3R15 381-2313 17-Aug-19...
Date: Mon, 17 Aug 1992 13:28
60 lines
3204 bytes
James Wilkinson (jwilkinson@lucy.claremont.edu) writes:

>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.

If you want to program your own mouse button definitions, you could
do what EVE does:

    1.	Create a key_map to hold your mouse button definitions.
	The EVE V2.2-2.6 key_map is EVE$X_MOUSE_KEYS.  Look in module
	EVE$MOUSE.TPU for how EVE handles mouse buttons.

    2.	Define mouse buttons in the key_map, or trap them all in an
	undefined_key procedure.

    3.	Create a key_map_list containing the key_map from step 1.
	The EVE key_map_list is EVE$X_MOUSE_LIST.

    4.	Set the key_map_list on the windows in which you want to process mouse
	buttons (this is different from processing keystrokes where you set
	a key_map_list on your buffers).  In EVE$WINDOWS.TPU you will find
	statements like the following:

	    set (KEY_MAP_LIST, eve$x_mouse_list, eve$$x_windows {1});

	EVE$$X_WINDOWS is an array whose first element is the top window,
	and subsequent elements {2}, {3}, etc are other user windows created
	using the SPLIT WINDOW command.

Realize that you only get mouse DOWN and UP buttons on character cell
terminals or DECTerms.  You get drag and click events only using the
DECwindows interface to TPU.  In your undefined_key procedure you can
get the window (and buffer) in which the mouse button occurred plus the row
and column numbers by using the LOCATE_MOUSE built-in.  The LAST_KEY
built-in holds the key name of the last button pressed.  And, before
you can cut/paste between DECterms or other DECwindows applications,
you have to shut off TPU's mouse processing by using the
SET (MOUSE,OFF) built-in.  The following example works only using
the default of SET (MOUSE, ON):

procedure foo
local   x,y,win;
locate_mouse(win,x,y);
message ("Mouse button=" + str (last_key) +
	', buffer='+ get_info (get_info (win, 'buffer'), 'name')+
        ', x='+str(x)+', y='+str(y));
endprocedure

qwer := create_key_map ('qwer');
asdf := create_key_map_list ("asdf", qwer);
set (key_map_list, asdf, current_window);
set (UNDEFINED_KEY, asdf, "foo");

Bill
Former EVE/TPU developer
 _________________________________________________________________________
 Bill Robinson                               | robinson@tle.enet.dec.com
 Digital Equipment Corporation, Nashua, NH   | Opinions are my own.
Technical Details
Message-ID: <9208171328.AA15522@enet-gw.pa.dec.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!info-tpu-newsgate!list

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!info-tpu-newsgate!list
Newsgroups: vmsnet.tpu
Subject: Re: How to obtain X button press info from character cell
Message-ID: <9208171328.AA15522@enet-gw.pa.dec.com>
From: "bill, ZK2-3/R15, 381-2313  17-Aug-1992 0930"
Date: Mon, 17 Aug 92 06:28:47 PDT
Reply-To: "Bill, ZK2-3/R15, 381-2313  17-Aug-1992 0930"
Organization: The Internet
Return-Path: <TPU-Mgr@SHSU.edu>
Errors-To: TPU-Mgr@SHSU.edu
X-Listname: Text Processing Utility (TPU) Language Discussion List
Apparently-To: info-tpu@shsu.edu
Lines: 61