Forum Discussion

Tom_Test's avatar
Tom_Test
Contributor
7 years ago

Drag, wait, drop?

Hi,

 

I’m trying to test this:

I drag an object with the mouse onto a node in an object tree. While I hoover over the node, the node opens up and I place the object in the desired position between the already existing objects under this node.

 

The drag method has no delay/wait option so it just drops the object on the node before it opens up.

 

Using jscript I tried MouseDown, MouseMove, MouseUp and than the same using the LLPlayer. Both didn’t drag the object.

 

Has anybody done this before and can share me some advice?

 

Thank you in advance!

 

Tom

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Tom,

     

    I did not do exactly your scenario, but LLPlayer should work.

    The general idea is that with LLPlayer you should be able to do a drag to the required position and then wait until the node is expanded, calculate the proper position for the dragged object to be dropped to, drag to this position and only then release the pressed left mouse button.

    Have you tried this? Doesn't it work?

    • Tom_Test's avatar
      Tom_Test
      Contributor

      Hi Alex,

       

      That’s my problem. It should do want I want but it don’t.

       

      Give or take some extra delays I used this:

       

        var coordX = 640;

        var coordY = 520; 

        var sDelay = 3000;

        var destX = 1200;

        var destY = 430;

            

        LLPlayer.MouseDown(MK_LBUTTON, coordX, coordY, sDelay);

        LLPlayer.MouseMove(destX, destY, sDelay);

        LLPlayer.MouseUp(MK_LBUTTON, destX, destY, sDelay);

       

      It clicks on the object, waits 3 seconds and then jumps to the node but without dragging the object. The mousepointer doesn’t have the extra rectangle that indicates an object drag and it doesn’t move with the normal speed I see in other tests. It’s more like jumping from start to target.

       

      Regards,

      Tom

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Tom,

         

        Try to make mouse moving more smooth - for the project properties select Playback and increase the value of the Mouse Movement Delay parameter from (assumed) zero to, say, 50. (Dragging Delay parameter may be set to the same 50 value. Just in case...)
        Does this help ?