Re: [FUTUREBASIC] Found compiler limitation...need to know how to post "mouse-up" event to FB.
Quote from Forum Archives on November 8, 1997, 4:54 pmPosted by: rbrown <rbrown@...>
M Goodes wrote:
> ...I was able to track the problem to a loop that had a safety exit that I
> always put in during program development, in case an infinite loop occurs:
> DO
> ...code that could result in an infinite loop if given an improper value...
> UNTIL condition OR MOUSE(_DOWN)
> It turns out the MOUSE(_DOWN) keeps getting triggered. Why? Because I
> have a control panel extension installed called "StickyClick", which allows
> you to click on a menu once and have the menu keep being displayed until
> you click the mouse again. It does this by changing the "mouseup" event
> when you take your thumb off the trackball button to a "stilldown" event.
> When you click the mouse again, the extension changes it to a "mouse-up"
> event.
>
> My guess is that FB has its own internal data structures to handle events
> and does not see all the legerdemain that the "StickClick" extension is
> doing.My guess is that FB _does_ see what "StickyClick" is doing--else I can't
imagine how "StickyClick" could be affecting FB's MOUSE(_down) function.MOUSE(_down) calls a Toolbox function called "Button," which in turn
checks the global variable "MBState," which is supposed to contain zero
if the button is down, or non-zero if the button is up. My guess is
that "StickyClick" is directly manipulating that global variable when
"mouse-down" and "mouse-up" events occur. There is no such thing as a
"stilldown event"; however, the Menu Manager (etc.) call the StillDown
_function_ to determine whether the mouse is still down. StillDown also
calls Button.I'll bet "StickyClick" just works like this:
Initialize StickyFlag (a private variable) to false;
Do forever:
If mouse-down occurs, then:
toggle the value of StickyFlag;
ElseIf mouse-up occurs, then:
If SickyFlag is true, then:
set MBState to false (simulate button down);
Else
set MBState to true (simulate button up);
End if
Remove mouse-up event from queue
End ifIf that's the case, the posting your own mouse-up events might not do
any good. My advice would be to do a "POKE _MBState, 128" just before
you enter your DO loop. That will make the mouse button look like it's
"up," in case StickyClick has set this global to look like the button's
down.- Rick
Posted by: rbrown <rbrown@...>
> ...I was able to track the problem to a loop that had a safety exit that I
> always put in during program development, in case an infinite loop occurs:
> DO
> ...code that could result in an infinite loop if given an improper value...
> UNTIL condition OR MOUSE(_DOWN)
> It turns out the MOUSE(_DOWN) keeps getting triggered. Why? Because I
> have a control panel extension installed called "StickyClick", which allows
> you to click on a menu once and have the menu keep being displayed until
> you click the mouse again. It does this by changing the "mouseup" event
> when you take your thumb off the trackball button to a "stilldown" event.
> When you click the mouse again, the extension changes it to a "mouse-up"
> event.
>
> My guess is that FB has its own internal data structures to handle events
> and does not see all the legerdemain that the "StickClick" extension is
> doing.
My guess is that FB _does_ see what "StickyClick" is doing--else I can't
imagine how "StickyClick" could be affecting FB's MOUSE(_down) function.
MOUSE(_down) calls a Toolbox function called "Button," which in turn
checks the global variable "MBState," which is supposed to contain zero
if the button is down, or non-zero if the button is up. My guess is
that "StickyClick" is directly manipulating that global variable when
"mouse-down" and "mouse-up" events occur. There is no such thing as a
"stilldown event"; however, the Menu Manager (etc.) call the StillDown
_function_ to determine whether the mouse is still down. StillDown also
calls Button.
I'll bet "StickyClick" just works like this:
Initialize StickyFlag (a private variable) to false;
Do forever:
If mouse-down occurs, then:
toggle the value of StickyFlag;
ElseIf mouse-up occurs, then:
If SickyFlag is true, then:
set MBState to false (simulate button down);
Else
set MBState to true (simulate button up);
End if
Remove mouse-up event from queue
End if
If that's the case, the posting your own mouse-up events might not do
any good. My advice would be to do a "POKE _MBState, 128" just before
you enter your DO loop. That will make the mouse button look like it's
"up," in case StickyClick has set this global to look like the button's
down.
- Rick