DragRecognizer

open class DragRecognizer(target: EventTarget, callback: (GestureRecognizer) -> Unit? = null) : GestureRecognizer

A concrete gesture recognizer subclass that looks for mouse drag gestures.

Constructors

Link copied to clipboard
constructor(target: EventTarget, callback: (GestureRecognizer) -> Unit? = null)

Properties

Link copied to clipboard
Link copied to clipboard

Indicates the X coordinate of this gesture.

Link copied to clipboard

Returns the Y coordinate of this gesture.

Link copied to clipboard

The list of functions to call when this gesture is recognized. The functions have a single argument: this gesture recognizer, e.g., gestureCallback(recognizer). Applications may add functions to this array or remove them.

Link copied to clipboard
Link copied to clipboard

Indicates whether this gesture recognizer is enabled. When false, this gesture recognizer will ignore any events dispatched by its target.

Link copied to clipboard

Indicates the currently pressed mouse buttons as a bitmask. A value of 0 indicates that no buttons are pressed. A nonzero value indicates that one or more buttons are pressed as follows: bit 1 indicates the primary button, bit 2 indicates the auxiliary button, bit 3 indicates the secondary button.

Link copied to clipboard
var state: GestureState

Indicates this gesture's current state. Possible values are POSSIBLE, FAILED, RECOGNIZED, BEGAN, CHANGED, CANCELLED and ENDED.

Link copied to clipboard

Indicates the document element this gesture recognizer observes for mouse and touch events.

Link copied to clipboard

Indicates the number of active touches.

Link copied to clipboard

Indicates this gesture's translation along the X axis since the gesture started.

Link copied to clipboard

Indicates this gesture's translation along the Y axis since the gesture started.

Functions

Link copied to clipboard

Registers a gesture state listener on this GestureRecognizer. Registering state listeners using this function enables applications to receive notifications of gesture recognition.

Link copied to clipboard
fun handleEvent(event: Event)
Link copied to clipboard
Link copied to clipboard

Removes a gesture state listener from this GestureRecognizer. The listener must be the same object passed to addListener. Calling removeListener with arguments that do not identify a currently registered listener has no effect.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun reset()
Link copied to clipboard
fun touch(index: Int): TouchWrapper