[comp.sys.atari.st.tech] Reading both buttons from Eventmulti

dcrevier@jarthur.Claremont.EDU (Dan Crevier) (11/02/90)

I remember a while ago people were discussing how to get an event from the
right button _or_ the left button.  I wasn't paying attention then, but now
I have found I want to do that, and I can only seem to read events from both
buttons pressed together.  I think I remember the solution being simple.
Could someone post the solution?

Dan

dcrevier@jarthur.claremont.edu

csbrod@medusa.informatik.uni-erlangen.de (Claus Brod ) (11/02/90)

dcrevier@jarthur.Claremont.EDU (Dan Crevier) writes:

>I remember a while ago people were discussing how to get an event from the
>right button _or_ the left button.  I wasn't paying attention then, but now
>I have found I want to do that, and I can only seem to read events from both
>buttons pressed together.  I think I remember the solution being simple.
>Could someone post the solution?

One method - undocumented though, but valid for all TOS/GEM versions -
is to add 256 to the number of clicks waited for. This negates the condition
for a return from evnt_multi due to clicks. Example:

	mstate = 0
	mclicks = 256+2
	mbuttons = 3

This means: Wait for 'NOT both buttons released' = 'One button clicked'.

I know this is undocumented stuff but _very_ useful. And I would love it
if Mr Pratt or someone else at ATARI could promise us that this feature
will stay. PLEASE Mr Pratt - do us a favour. The only other way I know
of something like selective mouse click waiting can be done is linking
into the mouse vectors and - whenever the right button is clicked -
pretending that it is indeed the left one. But this causes much trouble
everywhere, and it is not even completely legal - after all, you have
to use those VDI mouse movement vector exchange routines that are
reserved for AES use only.

----------------------------------------------------------------------
Claus Brod, Am Felsenkeller 2,			Things. Take. Time.
D-8772 Marktheidenfeld, West Germany		(Piet Hein)
csbrod@medusa.informatik.uni-erlangen.de
----------------------------------------------------------------------

horsch@cs.ubc.ca (Michael Horsch) (11/04/90)

In article <3209@medusa.informatik.uni-erlangen.de> csbrod@medusa.informatik.uni-erlangen.de (Claus Brod ) writes:
:dcrevier@jarthur.Claremont.EDU (Dan Crevier) writes:
:
:>I remember a while ago people were discussing how to get an event from the
:>right button _or_ the left button.  
:
:One method - undocumented though, but valid for all TOS/GEM versions -
:is to add 256 to the number of clicks waited for. This negates the condition
:for a return from evnt_multi due to clicks. Example:
:
:	mstate = 0
:	mclicks = 256+2
:	mbuttons = 3
:
:This means: Wait for 'NOT both buttons released' = 'One button clicked'.
:
:I know this is undocumented stuff but _very_ useful. And I would love it
:if Mr Pratt or someone else at ATARI could promise us that this feature
:will stay. PLEASE Mr Pratt - do us a favour. The only other way I know
:of something like selective mouse click waiting can be done is linking
:into the mouse vectors and - whenever the right button is clicked -
:pretending that it is indeed the left one. But this causes much trouble
:everywhere, and it is not even completely legal - after all, you have
:to use those VDI mouse movement vector exchange routines that are
:reserved for AES use only.

So what's wrong with alternating the value of mbuttons in the
loop containing event_multi()?  On each pass through the loop, 
check for only one button, and at the end of the loop change the
value of mbuttons to the other mouse button (ex-or mbuttons with
3).  Easy.

This is completely legal, maintains consistency and context, and 
it even works.  I've used it myself.  I can't think of any reason 
that this idea might interfere with any other legal use of AES 
stuff.

:----------------------------------------------------------------------
:Claus Brod, Am Felsenkeller 2,			Things. Take. Time.
:D-8772 Marktheidenfeld, West Germany		(Piet Hein)
:csbrod@medusa.informatik.uni-erlangen.de
:----------------------------------------------------------------------

Mike

--
Michael C. Horsch		Dept. of Computer Science, 
horsch@cs.ubc.ca		University of British Columbia

askrid@netmbx.UUCP (Dirk Ahrens) (11/06/90)

In article <10330@ubc-cs.UUCP> horsch@cs.ubc.ca (Michael Horsch) writes:
>In article <3209@medusa.informatik.uni-erlangen.de>
>>csbrod@medusa.informatik.uni-erlangen.de (Claus Brod ) writes:
>>One method - undocumented though, but valid for all TOS/GEM versions -
>>is to add 256 to the number of clicks waited for. This negates the condition
>>for a return from evnt_multi due to clicks. Example:
>>This means: Wait for 'NOT both buttons released' = 'One button clicked'.
>
>So what's wrong with alternating the value of mbuttons in the
>loop containing event_multi()?  On each pass through the loop, 
>check for only one button, and at the end of the loop change the
>value of mbuttons to the other mouse button (ex-or mbuttons with
>3).  Easy.
>Michael C. Horsch		Dept. of Computer Science, 
>horsch@cs.ubc.ca		University of British Columbia

The problem  is, you got to have an event_timer in your loop otherwise you
will never be able to change the values.
If there is no timed event, why should you specify it, and the gem-dispatcher
is doing more, than he must do.

Since this 'feature' exists since tos 1.0, it needs a simple "we will keep it"
from Atari to avoid 'workarounds' like yours.
If, on the other side, atari sais "this is subject of change" we have to use
this, or any other solution.
But I doubt, there is any solution, that is as elegant as 
the above. 

Greetings	Dirk 

-- 
 Askrid	   netmbx, Jabba the Hutt.
 askrid@netmbx.UUCP  dirk@opal.cs.tu-berlin.de  AHRENS@TUBVM.CS.TU-BERLIN.DE
 Dirk Ahrens - Danckelmannstr 46 - 1000 Berlin 19 - Federal Republic of Germs