Page 1 of 1
mouseDoubleDown Problems
Posted: Mon May 07, 2007 10:47 am
by johnmiller1950
Greeting All,
I am updating a program that I originally wrote using Revolution 2.2.1.
In a list field, a mouseDoubleDown first sends a mouseUp and then the mouseDoubleDown.
Under 2.7.4, it is sending a mouseUp, a mousedoubledown, and then another mouseUp. This is causing problems.
Does anyone know how to get around this problem?
Thanks,
John Miller
Posted: Mon May 07, 2007 7:10 pm
by xApple
Make a variable that counts the number of "MouseUp" and discards the second one. Not much of a solution, I know : )
Posted: Mon May 07, 2007 8:45 pm
by Mark
Hi John,
A similar problem has been reported to the QC already. You might want to post a comment.
http://quality.runrev.com/qacenter/show_bug.cgi?id=4610
If you comment on the bug, it might be helpful if you added a more elaborate explanation together with your scripts.
Best,
Mark
MouseDoubleDown Problems
Posted: Fri Jan 18, 2008 5:47 pm
by trevix
On OSX 10.4.9 I also noticed that if you doubleckick too fast, or as fast as you would usually do on any application, no MouseDoubleDown (or MouseDoubleUp) get sent. You must do it slowly in order to work (or you get just down and up).
Is there a way to solve this problem ?
Regards
Posted: Fri Jan 18, 2008 7:39 pm
by FourthWorld
Are you sure you want mouseDoubleDown rather than mouseDoubleUp?
Posted: Sat Jan 19, 2008 12:39 am
by trevix
It does not really matter... I've put MouseDoubleUp with the same result and I dont see the differences between the two (the docs does not mention any differences...).
One result I've obtained, is putting a "wait 100 milliseconds with messages" on the mouseDown and checking the statements called by the MouseDown for a mouse up.
If the mouse is up then exit mousedown
In this wait the MouseDoubleUp (or Down) answers right away perhaps because it does not follow all the lines called by the mousedown.
I may have resolved it.
Posted: Sat Jan 19, 2008 10:48 pm
by FourthWorld
trevix wrote:It does not really matter...
It just might. While I've only been working with this language for 12 years, in that short time I've helped a few people find acceptable workarounds for things not too different from this.
Could I trouble you to describe what it is your UI does?
And how closely does your setup match the one described in the recipe for the above-referenced bug report?
And for the others here: Why do you suppose that bug report has zero votes? Did the original author find a workaround? Is the circumstance needed to replicate so very specific that it doesn't affect many people?
MouseDoubleDown ProblemsLet'see if I can explain:
Posted: Sun Jan 20, 2008 2:02 pm
by trevix
Let'see if I can explain:
I'm making a classic calendar, where appointment rettangles (made with fields), strech vertically on the hours and are positioned on the days of the week.
- When I doubleclick the field, it opens up a dialog with the details of the appointement.
- When I hold down the mouse on the field, I can drag it around to reposition it on the week.
What it appens (I think) is that if I double click at normal speed (my normal speed), the script first follows the MouseUp, then the MouseDown (I know...it is strange, should be reverse) then it looks like is too late to catch the DoubleClick...so it just do another MouseUp and mouseDown(I've tracked it). This does not happen if I doubleClick slowly (it tracks as a Up, Down and Double).
I must say that each MouseUp and MouseDown on the field, continue on the stack with long script. That's why I tried to stop them putting on the MouseDown script a "if the mouse is up then exit mousedown".
My feeling is that the MouseDoubleUp should reset whatever came before...
Hope I was clear. Thanks for any help.
Trevix
Posted: Sun Jan 20, 2008 2:39 pm
by Mark
Trevix,
Are you saying that if you double-click, both the mouseDoubleClick and the mouseUp messages are sent?
This shouldn't happen according to the docs:
"If the click is the second click of a double click, the mouseDoubleUp message is sent instead of mouseUp."
However, it does happen and I believe it should be fixed. You might want to vote for (or maybe I should say against) this bug:
http://quality.runrev.com/qacenter/show_bug.cgi?id=3567
Best,
Mark
Posted: Sun Jan 20, 2008 4:01 pm
by trevix
Exactely.
Make a locked field with this:
Code: Select all
on mousedown
FromMouseDown
end mousedown
on mouseup
FromMouseup
end mouseup
on MouseDoubleUp
FromMouseDoubleUp
end MouseDoubleUp
Then put this in the stack:
Code: Select all
on FromMousedown
--wait 1 seconds with messages
put "FromMousedown" & return after msg
end FromMousedown
on FromMouseup
--wait 1 seconds with messages
put "FromMouseup" & return after msg
end FromMouseup
on FromMouseDoubleUp
--wait 1 seconds with messages
put "MouseDoubleUp" & return after msg
end FromMouseDoubleUp
Interesting enough, if you use the 1 seconds delay, no doubleclick get sent anymore. This should not be because if you have a complex enough MouseDown script, the MouseDoubleUp behaves randomly.
I'm not sure I understand the "quality control center" stuff enough to post anything.
Anyway the MouseDoubleDown should flush everything from the mouseDown and MouseUp...My 50 milliseconds delay is not a great solution since you feel the delay on the mouse...
Regards
Trevix
Posted: Sun Jan 20, 2008 11:30 pm
by FourthWorld
If you could create the simplest possible example stack which illustrates this issue, I'd be happy to dig into it and see if I could coerce it to do what you want.
In the meantime, if all else fails there may be a way to use the flushEvents function to purge unwanted messages....
MouseDoubleDown Problems
Posted: Tue Jan 22, 2008 10:44 am
by trevix
You are very kind. My stack is complex and it's hard to simplify it. But the main point is that MouseDoubleDown does not work consistently...
try this:
on a locked fld:
Code: Select all
on mousedown
FromMouseDown
end mousedown
on mouseup
FromMouseup
end mouseup
on MouseDoubleUp
--get flushEvents("all")
FromMouseDoubleUp
end MouseDoubleUp
on the stack:
Code: Select all
on FromMousedown
repeat with i= 1 to 1000000
put "FromMousedown" & return into FromClick
--if the mouse is up then exit repeat
end repeat
put FromClick after msg
end FromMousedown
on FromMouseup
repeat with i= 1 to 1000000
put "FromMouseup" & return into FromClick
--if the mouse is down then exit repeat
end repeat
put FromClick after msg
end FromMouseup
on FromMouseDoubleUp
repeat with i= 1 to 1000
put "MouseDoubleUp" & return into FromClick
end repeat
put FromClick after msg
end FromMouseDoubleUp
You'll see that the FlushEvents("all") does nothing and that intercepting ("if the mouse is up...") MouseDown or MouseUp, makes them no to work.
The point is that there should be a simple way to stop mouseDown and MouseUp script when you doubleclick...
Posted: Tue Jan 22, 2008 9:56 pm
by FourthWorld
> The point is that there should be a simple way to stop mouseDown
> and MouseUp script when you doubleclick...
Thanks for the explanation.
The problem, if we can call it that, is that the mouse does go down and up prior to a mouseDoubleUp, so the messages appear to be firing correctly.
In my own UIs I generally want the mouseUp in addition to mouseDoubleUp. What is your UI doing that makes this problematic?
Posted: Wed Jan 23, 2008 1:39 pm
by trevix
As from my first post (18 gen):
I the mouseDown and MouseUp script are long and complex, often the mousedoubleup does not work. Or it works only if you doubleclick slowly...
Posted: Thu Jan 24, 2008 8:07 pm
by trevordevore
Since you mention that your mouseDown/mouseUp scripts are long and complex it may be possible that the scripts haven't finished running yet and that is interfering with the mouseDoubleUp message. I'm just guessing here as I don't know if that is possible.
In any case, what if you tried something like this:
Code: Select all
on mouseUp
send "PerformLongAndComplexHandler" to me in 0 seconds
end mouseUp
on mouseDown
send "PerformOtherLongAndComplexHandler" to me in 0 seconds
end mouseDown
on mouseDoubleUp
send "PerformDoubleUpAction" to me in 0 seconds
end mouseDoubleUp
The idea here is that you end up executing the scripts directly after the engine events mouseUp/mouseDown. Perhaps this will allow mouseDoubleUp to get called correctly each time.