Double Tap by Coordinates
The Double Tap by Coordinates action performs two consecutive taps at the specified screen coordinates. This action is useful for applications that interpret a double tap differently from a single tap, such as image viewers, maps, or custom graphical interfaces.
When to Use
Use this action when you want to:
- Zoom into an image.
- Open an item that requires a double tap.
- Interact with applications that recognise double-tap gestures.
Syntax
var task = suremdmjs.automate().doubleTapCoordinates(
<X Coordinate>,
<Y Coordinate>
);
suremdmjs.automate().performAction(
task,
"onSuccess",
"onFailure"
);
Parameters
| Parameter | Required | Description |
|---|---|---|
| X Coordinate | Yes | Horizontal screen coordinate in pixels. |
| Y Coordinate | Yes | Vertical screen coordinate in pixels. |
Example
!#suremdmjs
zoomImage();
function zoomImage() {
var task = suremdmjs.automate().doubleTapCoordinates(
540,
900
);
suremdmjs.automate().performAction(
task,
"zoomCompleted",
"zoomFailed"
);
}
function zoomCompleted() {
suremdmjs.log("Double tap completed.");
}
function zoomFailed() {
suremdmjs.log("Unable to perform double tap.");
}
Expected Result
A double tap is performed at the specified screen location.