TouchEvent

open class TouchEvent(val type: EventType<TouchEvent>, init: TouchEventInit = definedExternally) : UIEvent(source)

The TouchEvent interface represents an UIEvent which is sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth.

MDN Reference

Constructors

Link copied to clipboard
constructor(type: EventType<TouchEvent>, init: TouchEventInit = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The read-only altKey property of the TouchEvent interface returns a boolean value indicating whether or not the alt (Alternate) key is enabled when the touch event is created. If the alt key is enabled, the attribute's value is true. Otherwise, it is false.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The changedTouches read-only property is a TouchList whose touch points (Touch objects) varies depending on the event type, as follows:

Link copied to clipboard
Link copied to clipboard

The read-only ctrlKey property of the TouchEvent interface returns a boolean value indicating whether the control (Control) key is enabled when the touch event is created. If this key is enabled, the attribute's value is true. Otherwise, it is false.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val detail: Int

The UIEvent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The read-only metaKey property of the TouchEvent interface returns a boolean value indicating whether or not the Meta key is enabled when the touch event is created. If this key is enabled, the attribute's value is true. Otherwise, it is false.

Link copied to clipboard
Link copied to clipboard

The read-only shiftKey property of the TouchEvent interface returns a boolean value indicating whether or not the shift key is enabled when the touch event is created. If this key is enabled, the attribute's value is true. Otherwise, it is false.

Link copied to clipboard
Link copied to clipboard

The targetTouches read-only property is a TouchList listing all the Touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.

Link copied to clipboard
Link copied to clipboard

touches is a read-only TouchList listing all the Touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.

Link copied to clipboard
open override val type: EventType<TouchEvent>
Link copied to clipboard
val view: Window?

The UIEvent.view read-only property returns the WindowProxy object from which the event was generated. In browsers, this is the Window object the event happened in.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard