doubleClick

Function

Common
fun MouseInjectionScope.doubleClick(
    position: Offset = center,
    button: MouseButton = MouseButton.Primary,
)

Use button to double-click on position, or on the current mouse position if position is unspecified. The position is in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default button is the primary button.

Parameters

positionThe position where to click, in the node's local coordinate system. If omitted, the center of the node will be used. If unspecified, clicks on the current mouse position.
buttonThe button to click with. Uses the primary by default.
Common

Deprecated Replaced by TouchInjectionScope. Use performTouchInput instead of performGesture

fun GestureScope.doubleClick(
    position: Offset = center,
    delayMillis: Long = doubleClickDelayMillis,
) = delegateScope.touch { doubleClick(position, delayMillis) }

Performs a double click gesture at the given position on the associated node, or in the center if the position is omitted. By default, the delayMillis between the first and the second click is 145 milliseconds (empirically established). The position is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Parameters

positionThe position of the double click, in the node's local coordinate system. If omitted, the center position will be used.
delayMillisThe time between the up event of the first click and the down event of the second click
Common
fun TouchInjectionScope.doubleClick(
    position: Offset = center,
    delayMillis: Long = viewConfiguration.defaultDoubleTapDelayMillis,
)

Performs a double click gesture (aka a double tap) on the associated node.

The double click is done at the given position or in the center if the position is omitted. By default, the delayMillis between the first and the second click is half way in between the minimum and maximum required delay for a double click. The position is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Parameters

positionThe position of the double click, in the node's local coordinate system. If omitted, the center position will be used.
delayMillisThe time between the up event of the first click and the down event of the second click