-
Jan 21st, 2021, 05:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] MouseDown vs Click or DblClick
I know the firing sequences for MouseDown vs Click or DblClick. My problem is that when I do a MouseDown I want to drag (MouseDown, MouseMove, MouseUP). When I DblClick, or click (whichever is easier to code, I want to execute something else. I am clicking on a PB.
Yes, it is game. Either I drag a card, or I have the card snap to another destination.
Thanks
-
Jan 21st, 2021, 05:29 PM
#2
Re: MouseDown vs Click or DblClick
what is stopping u?
they are different triggers, it should work.
bad idea to use Click, since a person could click by mistake or regret. better to use DblClick to make the card to be placed automatically. (or why not a key, like if u mouseover a card and use a key to transfer the card)
-
Jan 21st, 2021, 06:05 PM
#3
Thread Starter
Fanatic Member
Re: MouseDown vs Click or DblClick
MouseDown always happens first. Then Mouseup and then DblCLick
-
Jan 21st, 2021, 06:07 PM
#4
Re: MouseDown vs Click or DblClick
theres no easy ways here.
what u could do is to have a timer, ½ second before mousedown is attaching the card. enough time to allow a double click.
-
Jan 21st, 2021, 06:14 PM
#5
Thread Starter
Fanatic Member
Re: MouseDown vs Click or DblClick
I can determine using Passel's "Closest_Card_in_Range" if I want a drag (MU,MM, MU) or a snap to. right now I can only do it as if it is a Click.
-
Jan 21st, 2021, 06:28 PM
#6
Re: MouseDown vs Click or DblClick
u have all the triggers there, u just need to control them better.
when mouse down, u call a "search closest card", if found, u set a variable to 100, like cardonhold = 100
the timer/loop u use
if cardonhold > 0 then
cardonhold = cardonhold - somenumber
if cardonhold < 1 then attachcardtomouse = true
but if u call mouse up, before cardonhold is 0 it will reset it, so the it will not attach it.
that will allow u to use doubleclick.
-
Jan 31st, 2021, 12:47 PM
#7
Thread Starter
Fanatic Member
Re: MouseDown vs Click or DblClick
I have not worked the program for days. I don't know when I will get back to it.
Therefore, I will close this thread. I believe I can follow baka's last post.
Thanks for your help.
-
Jan 31st, 2021, 01:04 PM
#8
Re: [RESOLVED] MouseDown vs Click or DblClick
Don't allow the drag to begin until the mouse has moved a few pixels, then you can do what you want with regard to the other events.
In MouseDown, store the X (or Y, or both). Then in MouseMove, if the left button is down, compare X to what you stored. If it's greater than (say) 4 pixels, begin the drag.
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|