Class: Toybox.WatchUi.ClickEvent

Overview

ClickEvent is an object sent to InputDelegate there is tap interaction with a device's touch screen.

See Also:

Example:

using Toybox.System;
using Toybox.WatchUi;

class InputDelegate extends WatchUi.BehaviorDelegate {
    function onTap(clickEvent) {
        System.println(clickEvent.getCoordinates()); // e.g. [36, 40]
        System.println(clickEvent.getType());        // CLICK_TYPE_TAP = 0
        return true;
    }
}

Since:

API Level 1.0.0

Instance Method Summary collapse

Instance Method Details

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

Get the coordinates of a click event.

Returns:

  • Lang.Array

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

Since:

API Level 1.0.0

getType() as WatchUi.ClickType

Get the type of click event.

Returns:

Since:

API Level 1.0.0


Generated Jun 6, 2024 10:31:54 AM