Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PdoxWin: How to detect mouse button status in MouseDown method....

0 views
Skip to first unread message

Zafar Ullah Choudhry

unread,
Aug 4, 1993, 10:10:07 AM8/4/93
to
I am trying to achieve a repeat on a mouse button. More specificly, I have
written MouseRightDown method for a button and I want to stay in this method
as long as right button on the mouse remains depressed. My problem is that
I don't know how to detect the state of the mouse button while in MouseRight
Down method. I want to use a loop in MouseRight method, that should break when
the right mouse button is lifted up.


Thanks.
Zafar.

Robert Cooper

unread,
Aug 4, 1993, 1:31:44 PM8/4/93
to

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
So how about setting a variable in MouseRightUp and then in your
MouseRightDown loop check to see if that variable is set or not?

Robert
--
Robert Cooper Brooklyn, NY | "We don't know who discovered water, but
co...@panix.com | we're pretty sure it wasn't a fish..."
212 309-9600 (Work) | Attributed to Marshall McLuhan

her...@cruzio.santa-cruz.ca.us

unread,
Aug 6, 1993, 11:24:45 PM8/6/93
to
In article <23orq0$l...@panix.com>, co...@panix.com (Robert Cooper) writes:
> In <23ofvv$2...@cville-srv.wam.umd.edu> chou...@wam.umd.edu (Zafar Ullah Choudhry) writes:
> >the right mouse button is lifted up.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> So how about setting a variable in MouseRightUp and then in your
> MouseRightDown loop check to see if that variable is set or not?


Because the MouseRightUp method won't execute while the loop in
MouseRightDown is executing.

Darren Clark

Bjorn Aannestad

unread,
Aug 7, 1993, 2:48:29 PM8/7/93
to
Here's an ugly way to do it. Perhaps with some additonal thought it can be
made better...

In the MouseRightDown method:
InitializeLoop()
setTimer(X) ; tune X for the best performance

In the MouseRightUp method:
stopTimer()
CleanUpAfterLoop()

In the Timer method, put the code from the body of the loop, with no loop
control code around it-- the timer will take care of invoking it over and over
until the mouse button is released.

-bjorn aannestad
aa...@ucsu.colorado.edu

0 new messages