Mouse Click & Double-Click

  • #1, by darren-beckettSaturday, 22. August 2015, 15:44 10 years ago
    Hi,
    I'm getting some strange behaviour with the mouse clicks that I'm hoping you can confirm if it's a bug or something i can work around.

    I have an object with 2 actions (Executed at destination), Single-Click (Look) and Double-Click (Use).

    If I Single-Click (Look) or Double-Click (Use) the object from a distance all works perfectly. (The character walks to the object and the correct action it fired).
    But, If the character has already walked up to the object and looked at it (Character is already stood at the object destination), then the Double-Click (Use) action doesn't get recognised, the Single-Click (Look) action gets called instead.

    It seems that if you Double-Click (Use) the object from a distance, this gives the engine time to fire before the Character reaches the object.

    Great Poster

    384 Posts


  • #2, by SimonSSunday, 23. August 2015, 21:54 10 years ago
    Hi,
    Double Click means a single click happened before, we can't know that a double click is coming, we would need to wait 1s until the action is executed, that would be shit.

    Thread Captain

    1593 Posts

  • #3, by darren-beckettMonday, 24. August 2015, 18:43 10 years ago
    Surely the single click shouldn't fire if you've double clicked.

    Great Poster

    384 Posts

  • #4, by darren-beckettMonday, 24. August 2015, 18:47 10 years ago
    A double-click should also happen in under 500ms, maybe even 350ms. Preferably it could be adjustable.

    Great Poster

    384 Posts

  • #5, by sebastianMonday, 24. August 2015, 18:51 10 years ago
    yeah but a double click includes a single click as i underatand it

    Thread Captain

    2346 Posts

  • #6, by darren-beckettMonday, 24. August 2015, 19:19 10 years ago
    Ok, I'll handle double-clicks myself then, thanks.

    Great Poster

    384 Posts

  • #7, by darren-beckettTuesday, 01. September 2015, 13:30 10 years ago
    I find it hard to believe that we cannot have both a Single-Click and a Double-Click action setup?

    It's quite a lot of work to create scripts to:
    1) Store the object clicked
    2) Wait for another click of the same object (Wait for ?ms)
    3) Call Single-Click or Double-Click action depending on click count

    Surely this is something that should be handled by the VS engine?

    Great Poster

    384 Posts

  • #8, by sebastianTuesday, 01. September 2015, 13:58 10 years ago
    you could try registering lua functions to the mouse event but i dont know how to dynamically bind them to your Objects

    Thread Captain

    2346 Posts

  • #9, by SimonSTuesday, 01. September 2015, 19:45 10 years ago
    If you really need to do that, you can define your own left click action, but you need to make "command executed" out of your actions. One for left click, one for double click. The left click action would be like

    save object
    wait 500ms or so
    if condition doubleclicked
    set condition doubleclicked to false
    set command doubleclick
    else
    set command singleclick
    endif
    execute command on saved object
    clear saved object

    And the double click action is just

    set condition doubleclicked to true

    Thread Captain

    1593 Posts