Class: Toybox.WatchUi.FlickEvent

Overview

FlickEvent is an object sent to InputDelegate when there is a flick interaction with the device's touch screen.

See Also:

Example:

using Toybox.System;
using Toybox.WatchUi;

class InputDelegate extends WatchUi.InputDelegate {
    function onFlick(flickEvent as FlickEvent) as Boolean {
        System.println(flickEvent.getDirection()); // e.g. up is 0, right is 90, down is 180, left is 270
        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 click event.

Returns:

  • Lang.Array

    An array containing the x and y coordinates at the end of the flick event as Numbers

Since:

API Level 3.3.0

getDirection() as Lang.Number

Get the direction of the flick.

Returns:

  • Lang.Number

    The direction of the flick in degrees

Since:

API Level 3.3.0

getDistance() as Lang.Number

Get the distance of the flick.

Returns:

Since:

API Level 3.3.0

getVelocity() as Lang.Float

Get the velocity of the flick.

Returns:

  • Lang.Float

    The velocity of the flick in pixels per second

Since:

API Level 3.3.0


Generated Apr 17, 2024 9:40:39 AM