Create a grab state image for cursor

Hello, I would like to have 3 states for the cursor: click, drag and grab.

I was able to manage the click and drag, but I would like to have a grab state as the user click in order to drag around. (19 KB)

I know that are many states in the Inspector area for the mouse but did not find the right version.

As always, thank you for your support!

Note that the On Drag event object has a hypeGesturePhase field:

When receiving a callback for the "On Drag" event with the "Run JavaScript…" action the event object also offers information about whether the current drag gesture has just started or ended, was canceled, or the coordinates were updated. To get that state, access the hypeGesturePhase property in the event object:

So I'd probably do something like change the drag() function to combine with the grab() and use this as a condition to determine which to show:

if(event['hypeGesturePhase'] == hypeDocument.kHypeGesturePhaseEnd || event['hypeGesturePhase'] == hypeDocument.kHypeGesturePhaseCancel) { = "url('${resourcesFolderName}/drag.png'), auto";
} else { = "url('${resourcesFolderName}/grab.png'), auto";

Thank you @jonathan !

1 Like