Class: Toybox.WatchUi.DragEvent

Overview

DragEvent is an object sent to InputDelegate when there is a drag interaction with a device's touch screen.

See Also:

Example:

using Toybox.System;
using Toybox.WatchUi;

class InputDelegate extends WatchUi.InputDelegate {
    function onDrag(dragEvent as DragEvent) as Boolean {
        System.println(dragEvent.getCoordinates()); // e.g. [36, 40]
        System.println(dragEvent.getType());        // DRAG_TYPE_START = 0
        return true;
    }
}

Since:

API Level 3.3.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

getCoordinates() as [ Lang.Number, Lang.Number ]

Get the coordinates of a drag event.

Returns:

  • Lang.Array

    An array containing the x and y coordinates of the drag event as Numbers

Since:

API Level 3.3.0

getType() as WatchUi.DragType

Get the type of drag event.

Returns:

Since:

API Level 3.3.0


Generated Sep 23, 2024, 3:32:49 PM