Results 1 to 8 of 8

Thread: [RESOLVED] MouseDown vs Click or DblClick

  1. #1

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Resolved [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

  2. #2
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    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)

  3. #3

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    Re: MouseDown vs Click or DblClick

    MouseDown always happens first. Then Mouseup and then DblCLick

  4. #4
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    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.

  5. #5

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    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.

  6. #6
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    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.

  7. #7

    Thread Starter
    Fanatic Member AccessShell's Avatar
    Join Date
    Oct 2013
    Posts
    790

    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.

  8. #8
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    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
  •  



Click Here to Expand Forum to Full Width