Breaking a Wait interaction

Is there a way to break the execution of a wait interaction?

For example, I have a tooltip that is shown after a wait of 500ms on mouseEnter, and i hide the tooltip on mouseExit.
The problem is that if the mouse exits before 500ms (you simply move the mouse over the widget quickly), the Hide interaction is followed by the Show (which was waiting), and the tooltip never disappears.

Curious as to how to solve this.

Thanks.

No, you can’t break or interrupt a Wait action. Nor can you break a sequence of actions.

What you are describing is a “conditional wait” --in other words, you want to wait 500 ms then test if the cursor is still over your widget: if true, show tooltip, if false do nothing (or hide tooltip just to be sure.) To do this, you’ll want to wait 500 ms then call another event–and that event can have a condition of “IF cursor is over area of widget” to show your tooltip widget. You can either use a separate widget or an otherwise unused event on that same widget, such as Moved or Rotated.

See this file for a demo:
conditional wait.rp (51.1 KB)

In the first example, the button has two actions in its Mouse Enter event: “Wait 500 ms, Move this by (0,0)” (which doesn’t actually move the button anywhere, it is just a way to fire the Moved event.) That Moved event has a conditional case of “IF cursor is over area of This, Show tooltip1” and just in case, an “Else Hide tooltip1”.

It turns out there is a built-in event of Mouse Hover to handle all of this, demonstrated in the second example. The advantage is it uses the browser’s standard timing and behaviors to handle timing of “mouse enters long enough to trigger something” like showing your tooltip, so it is more reliable and common. The disadvantage is you have no control of that timing (usually 1000 ms.)

And, of course, there is a built-in tooltip property which handles all of these details in a browser-standard manner, which makes everything very simple for you and has the most common/accessible/usable behaviors, but offers you the least design freedom. This is demonstrated in the third example.

Thanks mbc66, that’s very helpful. I can’t use the built-in tooltip because i have a custom looking tooltip, I will explore the other 2 solutions which seem to do exactly what I need.