| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jan 15, 2003 10:34 pm Post subject: Possible Bug: @mousedown() |
|
|
The script below doesn't seem to work. I've check it over several times
and it still displays the message box when I've clicked on the left button.
I'm probably overlooking the obvious....
| Code: | title Mouse Buttons
dialog create,Click on the Dialog Box,-1,0,240,160,click
dialog show
:evloop
wait event
goto @event()
:click
if @mousedown(R)
warn RIGHT mouse clicked!
end
goto evloop
:close
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team
Last edited by FreezingFire on Thu Jan 16, 2003 12:20 am; edited 2 times in total |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Wed Jan 15, 2003 11:11 pm Post subject: |
|
|
I don't use VDS 4...does mousedown have a return value?
%%mousedown = @mousedown(R)
if true return 1
else return 0
?
NodNarb |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jan 15, 2003 11:19 pm Post subject: |
|
|
Yes. Here's a quote from the help file:
| Quote: | Syntax:
@mousedown(<flags>)
Description:
Flags are L, M, R. Default L. Returns the state of the mentioned mouse button. If the button is down, it returns 1, if not it returns NULL. When specifying more than one flag, the return is a string of null or 1 separated by the standard VDS field separator.
OK:
Not changed.
Copyright © 1995 - 2002 S.A.D.E. s.a.r.l. / All rights are reserved. |
So using if @mousedown(R) should work.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Jan 15, 2003 11:20 pm Post subject: |
|
|
For some reason it's returning "R" instead of True or False..looks like a bug to me. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jan 15, 2003 11:24 pm Post subject: |
|
|
I've moved this topic to BUG REPORTS. I think it's a bug. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Wed Jan 15, 2003 11:31 pm Post subject: |
|
|
Verify:
Returns R on left and right mousedown?
NodNarb |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Jan 15, 2003 11:36 pm Post subject: |
|
|
@mousedown(R) Returns "R", @mousedown(L) Returns "L" and @mousedown(M) returns "M" no matter which button is clicked.. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Jan 15, 2003 11:37 pm Post subject: |
|
|
The function most certainly does not comply with the documentation, try this:
| Code: |
title Mouse Buttons
dialog create,Click on the Dialog Box,-1,0,240,160,click
dialog add,TEXT,T1,50,50,,,
dialog show
:evloop
wait event
goto @event()
:click
dialog set,T1,@mousedown(LMR)
goto evloop
:close
exit
|
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Jan 15, 2003 11:47 pm Post subject: |
|
|
FF, your syntax is off:
if @mousedown(R)
is gonna return true on any mouse click - it only checks for
existance of a return. Ya need to use:
if @equal(@mousedown(R), "R")
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Jan 15, 2003 11:49 pm Post subject: |
|
|
But it returns R no matter which mouse button is clicked Mac.
Help file says it should return 1 or NULL anyway. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 12:10 am Post subject: |
|
|
All of this aside, I found I should probably be using the following code:
| Code: | if @equal(@click(b),RIGHT)
dialog popup,Settings|Close
end |
But there's still the question:
Why does the <a href="file:///c:\program files\visual dialogscript\examples\mousedown.dsc">examples\mousedown.dsc</a> example work correctly then?
and why does it return the same letter no matter which button is clicked? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 16, 2003 12:17 am Post subject: |
|
|
Try this:
if @equal(@mousedown(LMR), "R")
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 12:17 am Post subject: |
|
|
OK, it's moved back to General Help because it's starting to look like a false
report. My syntax was off.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 12:19 am Post subject: |
|
|
| Mac wrote: | | if @equal(@mousedown(LMR), "R") |
Thanks.
I think both your example or the @click() example I found should fix my
problem.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 16, 2003 12:28 am Post subject: |
|
|
Also - it's prolly like @event() - if ya need it more than
once ya better stick it in a var, and it may work better
in one anyway...
| Code: |
%%test = @mousedown(LRM)
if @equal(%%test, "R")
DIALOG SET, Stat, Right
end
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
|