🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #37619

Re: Handling mouse button pushes

#37619
From: Ken Badertscher
Date: Sun, 02 Apr 1989 02:52
29 lines
2156 bytes
In article <8086@chinet.chi.il.us> saj@chinet.chi.il.us (Stephen Jacobs) writes:
|[stuff about evnt_multi problems monitoring mouse buttons deleted]
|1) Use the documented extended Line A variable to sense the mouse button
|   state whenever it might be interesting.
 
  A better solution than using line A variables is to use the VDI
vex_butv() call, inserting an interrupt handler of your own which saves
the button states in your local variables and passes off to the original
vector.  After you have installed your handler via vex_butv(), the
system will jsr to your code any time the mouse buttons' state changes. 
When you are done updating your local variables, you should jump through
the vector that was returned by vex_butv() so that the system gets the
button state change information as well. 
 
  This is just a pet peeve of mine; people tend to indiscriminantly use
the line-A variables rather than the VDI calls that are there.  In most
cases, it is not necessary (and sometimes dangerous) to use Line A
variables.  In this particular case, even if you're being very
conservative with what you do with button changes, you may run into
problems.  The AES maintains its own button state information
which is independant of the VDI/Line-A variables, and it is possible (if
you aren't careful) to get "out of sync" with the AES.
 
  Good luck with your button handling code, Stephen!

-- 
 Ken Badertscher                 | #include <disclaimer>
 Atari R&D                       | No pith, just a path:
 Software Engine                 |   {portal,ames,imagen}!atari!kbad
Technical Details
Message-ID: <1421@atari.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!atari!kbad
References: <8086@chinet.chi.il.us>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!atari!kbad
From: kbad@atari.UUCP (Ken Badertscher)
Newsgroups: comp.sys.atari.st
Subject: Re: Handling mouse button pushes
Summary: Use vex_butv() rather than line-a for custom mouse button monitoring.
Keywords: Line A, events, debouncing, buttons
Message-ID: <1421@atari.UUCP>
Date: 2 Apr 89 02:52:48 GMT
References: <8086@chinet.chi.il.us>
Reply-To: kbad@atari.UUCP (Ken Badertscher)
Organization: Atari Corp., Sunnyvale, CA
Lines: 29