[comp.sys.atari.st.tech] Answer to Right Mouse Button question

mreiss@ncrcam.Cambridge.NCR.COM (mreiss) (08/02/90)

Earlier this week (or was it last week) I asked a question about using
the right mouse butoon and about using both mouse buttons.  I got several 
answers.  Most of them were of the type - well, you can't do what you want
really, but here's a way to get around it.  I want to thank all of these
people for there responses.

I got answers from Claus Pederson, Greg Lindahl, and George Reimer.  Thank
you all for these answers.  In lieu of anything else, we probably would 
have chosen one of these solutions and done the best we could have.  These
solutions would have worked, that was obvious.

However, I got another message from Jan Timm.  I don't know what his source 
is, but I have sent him (I believe Jan is a him, but he could be a her.  If 
I am making an incorrect assumption I apologize.) a letter requesting that
info.  I am appending to this message Jan Timm's e-mail answer to my
request.  It is obviously the "correct" answer.  We have tested it and
it works !!!  GREAT !!!

Again thanks to all who answered and special thanks to Jan Timm.

From ncrcam!ncrlnk!relay.cs.net!cs.uni-sb.de!timm Tue Jul 31 18:59 EDT 1990
Received: from relay.cs.net by ncrlnk.Dayton.NCR.COM
          ; Tue, 31 Jul 90 18:18:32 -0400
Received: from [129.217.64.60] by RELAY.CS.NET id aa15426; 30 Jul 90 18:05 EDT
Received: from unisb-router.extern.Uni-Dortmund.DE 
	by unido.informatik.uni-dortmund.de with SMTP via EUnet (UNIDO-2.0.2.b) via EUnet
	for ncrcam.cambridge.ncr.com
	id AY24268; Tue, 31 Jul 90 00:10:18 +0100
Organization: Universitaet des Saarlandes
              D-6600 Saarbruecken FRG
Received: from sbsvax.cs.uni-sb.de with SMTP
          by uni-sb.de (5.61/UniSB-2.1)
          id AA27337; Tue, 31 Jul 90 00:12:00 +0200
Received: from fb14vax.cs.uni-sb.de with SMTP
          by cs.uni-sb.de (5.64/UniSB-2.1)
          id AA07671; Tue, 31 Jul 90 00:11:57 +0200
From: "Jan Timm" <timm@cs.uni-sb.de>
Date: Tue, 31 Jul 90 00:11:55 +0200
Message-Id: <9007302211.AA00233@fb14vax.cs.uni-sb.de>
Received: by fb14vax.cs.uni-sb.de; Tue, 31 Jul 90 00:11:55 +0200
To: mreiss@ncrcam.Cambridge.NCR.COM
Subject: Re: Right Mouse Button Programming

mreiss@ncrcam.Cambridge.NCR.COM (mreiss):
> 
> We are currently working on a project that we need to use the right mouse
> button.  (Really both buttons, but ...)  We have been able to get the left
> button to work fine ... single clicks, double clicks, event time out ...
> using evnt_multi.  It will not work for the right button.  The programming
> is the same, but it won't work.   WHY ?
> 
> I really need some help here.  PLEASE ... don't assume someone else will
> answer.  If you know what the problem is please send me email.
> 
> What?  You want to know what we are doing?  Well.... I won't tell and I won't
> answer email with questions about it until its done, but can you say mg with
> mouse support?  WE have the left button working, but we want the right button
> to work also.  PLEASE HELP
> 
> mike
> -- 
> Michael A. Reiss				|
> 						|	mike
> USENET = Mike.Reiss@Cambridge.NCR.COM		|

Hi,
I don't know what the problem is, but I read the following
should work: (with EVNT_BUTTON or EVNT_MULTI)
Set the parameters as follows:
bclicks mod 256 = #clicks   ==>  2 for doubleclicking
if blicks div 256 == 1 then negate the following condition.

bmask : Bit0 set: check for left button according to bstate
        Bit1 set: check for right button ...

bstate : Bit0 : 1 - left button pressed
                0 - left button released
         Bit1 : 1 - right button pressed
		0 - right button released

==> e.g. wait for "not both released" = "left OR right pressed":
bclicks=267 (click) or 258 (doubleclick)  /* NOT */
bmask=3  /* check left AND right */
bstate=0  /* left released, right released */

ev_bbutton lets you know which button was pressed then:
1 = left, 2 = right.


OK, maybe you knew all that, or maybe it doesn't work,
if it did help you, let me know.

Bye, Jan.

-- 
Michael A. Reiss				|
						|	mike
USENET = Mike.Reiss@Cambridge.NCR.COM		|