Skip to content

UIEventsAPI

Types

compositionEvent

The DOM CompositionEvent represents events that occur due to the user indirectly entering text. See CompositionEvent on MDN

type compositionEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
data: string,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
data
string

Module

There are methods and helpers defined in CompositionEvent .

compositionEventInit

type compositionEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable data?: string,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
data
option< string >

dataTransfer

Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. See DataTransfer on MDN

type dataTransfer = {
mutable dropEffect: string,
mutable effectAllowed: string,
items: dataTransferItemList,
types: array<string>,
files: WebAPI.DOMAPI.fileList,
}

Record fields

dropEffect
string

Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail.

Can be set, to change the selected operation.

The possible values are "none", "copy", "link", and "move". Read more on MDN

effectAllowed
string

Returns the kinds of operations that are to be allowed.

Can be set (during the dragstart event), to change the allowed operations.

The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", Read more on MDN

items

Returns a DataTransferItemList object, with the drag data. Read more on MDN

types
array< string >

Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". Read more on MDN

files

Returns a FileList of the files being dragged, if any. Read more on MDN

Module

There are methods and helpers defined in DataTransfer .

dataTransferItem

One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. See DataTransferItem on MDN

type dataTransferItem = {kind: string, type_: string}

Record fields

kind
string

Returns the drag data item kind, one of: "string", "file". Read more on MDN

type_
string

Returns the drag data item type string. Read more on MDN

Module

There are methods and helpers defined in DataTransferItem .

dataTransferItemList

A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. See DataTransferItemList on MDN

type dataTransferItemList = {length: int}

Record fields

length
int

Returns the number of items in the drag data store. Read more on MDN

Module

There are methods and helpers defined in DataTransferItemList .

eventModifierInit

type eventModifierInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >

focusEvent

Focus-related events like focus, blur, focusin, or focusout. See FocusEvent on MDN

type focusEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
relatedTarget: Null.t<WebAPI.EventAPI.eventTarget>,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int

Module

There are methods and helpers defined in FocusEvent .

focusEventInit

type focusEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable relatedTarget?: Null.t<
WebAPI.EventAPI.eventTarget,
>,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
relatedTarget
option< Null.t< WebAPI.EventAPI.eventTarget > >

inputEvent

type inputEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
data: Null.t<string>,
isComposing: bool,
inputType: string,
dataTransfer: Null.t<dataTransfer>,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
data
Null.t< string >
isComposing
bool
inputType
string
dataTransfer
Null.t< dataTransfer >

Module

There are methods and helpers defined in InputEvent .

inputEventInit

type inputEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable data?: Null.t<string>,
mutable isComposing?: bool,
mutable inputType?: string,
mutable dataTransfer?: Null.t<dataTransfer>,
mutable targetRanges?: array<WebAPI.DOMAPI.staticRange>,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
data
option< Null.t< string > >
isComposing
option< bool >
inputType
option< string >
dataTransfer
option< Null.t< dataTransfer > >
targetRanges
option< array< WebAPI.DOMAPI.staticRange > >

keyboardEvent

KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. See KeyboardEvent on MDN

type keyboardEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
key: string,
code: string,
location: int,
ctrlKey: bool,
shiftKey: bool,
altKey: bool,
metaKey: bool,
repeat: bool,
isComposing: bool,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
key
string
code
string
location
int
ctrlKey
bool
shiftKey
bool
altKey
bool
metaKey
bool
repeat
bool
isComposing
bool

Module

There are methods and helpers defined in KeyboardEvent .

keyboardEventInit

type keyboardEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
mutable key?: string,
mutable code?: string,
mutable location?: int,
mutable repeat?: bool,
mutable isComposing?: bool,
mutable charCode?: int,
mutable keyCode?: int,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >
key
option< string >
code
option< string >
location
option< int >
repeat
option< bool >
isComposing
option< bool >
charCode
option< int >
keyCode
option< int >

mouseEvent

Events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown. See MouseEvent on MDN

type mouseEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
screenX: int,
screenY: int,
clientX: int,
clientY: int,
layerX: int,
layerY: int,
ctrlKey: bool,
shiftKey: bool,
altKey: bool,
metaKey: bool,
button: int,
buttons: int,
relatedTarget: Null.t<WebAPI.EventAPI.eventTarget>,
pageX: float,
pageY: float,
x: float,
y: float,
offsetX: float,
offsetY: float,
movementX: float,
movementY: float,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
screenX
int
screenY
int
clientX
int
clientY
int
layerX
int
layerY
int
ctrlKey
bool
shiftKey
bool
altKey
bool
metaKey
bool
button
int
buttons
int
pageX
float
pageY
float
offsetX
float
offsetY
float
movementX
float
movementY
float

Module

There are methods and helpers defined in MouseEvent .

mouseEventInit

type mouseEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
mutable screenX?: int,
mutable screenY?: int,
mutable clientX?: int,
mutable clientY?: int,
mutable button?: int,
mutable buttons?: int,
mutable relatedTarget?: Null.t<
WebAPI.EventAPI.eventTarget,
>,
mutable movementX?: float,
mutable movementY?: float,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >
screenX
option< int >
screenY
option< int >
clientX
option< int >
clientY
option< int >
button
option< int >
buttons
option< int >
relatedTarget
option< Null.t< WebAPI.EventAPI.eventTarget > >
movementX
option< float >
movementY
option< float >

pointerEvent

The state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc. See PointerEvent on MDN

type pointerEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
screenX: int,
screenY: int,
clientX: int,
clientY: int,
layerX: int,
layerY: int,
ctrlKey: bool,
shiftKey: bool,
altKey: bool,
metaKey: bool,
button: int,
buttons: int,
relatedTarget: Null.t<WebAPI.EventAPI.eventTarget>,
pageX: float,
pageY: float,
x: float,
y: float,
offsetX: float,
offsetY: float,
movementX: float,
movementY: float,
pointerId: int,
width: float,
height: float,
pressure: float,
tangentialPressure: float,
tiltX: int,
tiltY: int,
twist: int,
altitudeAngle: float,
azimuthAngle: float,
pointerType: string,
isPrimary: bool,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
screenX
int
screenY
int
clientX
int
clientY
int
layerX
int
layerY
int
ctrlKey
bool
shiftKey
bool
altKey
bool
metaKey
bool
button
int
buttons
int
pageX
float
pageY
float
offsetX
float
offsetY
float
movementX
float
movementY
float
pointerId
int
width
float
height
float
pressure
float
tangentialPressure
float
tiltX
int
tiltY
int
twist
int
altitudeAngle
float
azimuthAngle
float
pointerType
string
isPrimary
bool

Module

There are methods and helpers defined in PointerEvent .

pointerEventInit

type pointerEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
mutable screenX?: int,
mutable screenY?: int,
mutable clientX?: int,
mutable clientY?: int,
mutable button?: int,
mutable buttons?: int,
mutable relatedTarget?: Null.t<
WebAPI.EventAPI.eventTarget,
>,
mutable movementX?: float,
mutable movementY?: float,
mutable pointerId?: int,
mutable width?: float,
mutable height?: float,
mutable pressure?: float,
mutable tangentialPressure?: float,
mutable tiltX?: int,
mutable tiltY?: int,
mutable twist?: int,
mutable altitudeAngle?: float,
mutable azimuthAngle?: float,
mutable pointerType?: string,
mutable isPrimary?: bool,
mutable coalescedEvents?: array<pointerEvent>,
mutable predictedEvents?: array<pointerEvent>,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >
screenX
option< int >
screenY
option< int >
clientX
option< int >
clientY
option< int >
button
option< int >
buttons
option< int >
relatedTarget
option< Null.t< WebAPI.EventAPI.eventTarget > >
movementX
option< float >
movementY
option< float >
pointerId
option< int >
width
option< float >
height
option< float >
pressure
option< float >
tangentialPressure
option< float >
tiltX
option< int >
tiltY
option< int >
twist
option< int >
altitudeAngle
option< float >
azimuthAngle
option< float >
pointerType
option< string >
isPrimary
option< bool >
coalescedEvents
option< array< pointerEvent > >
predictedEvents
option< array< pointerEvent > >

touch

A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. See Touch on MDN

type touch = {
identifier: int,
target: WebAPI.EventAPI.eventTarget,
screenX: float,
screenY: float,
clientX: float,
clientY: float,
pageX: float,
pageY: float,
radiusX: float,
radiusY: float,
rotationAngle: float,
force: float,
}

Record fields

identifier
int
screenX
float
screenY
float
clientX
float
clientY
float
pageX
float
pageY
float
radiusX
float
radiusY
float
rotationAngle
float
force
float

Module

There are methods and helpers defined in Touch .

touchEvent

An event 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. See TouchEvent on MDN

type touchEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
touches: touchList,
targetTouches: touchList,
changedTouches: touchList,
altKey: bool,
metaKey: bool,
ctrlKey: bool,
shiftKey: bool,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
targetTouches
changedTouches
altKey
bool
metaKey
bool
ctrlKey
bool
shiftKey
bool

Module

There are methods and helpers defined in TouchEvent .

touchEventInit

type touchEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
mutable touches?: array<touch>,
mutable targetTouches?: array<touch>,
mutable changedTouches?: array<touch>,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >
touches
option< array< touch > >
targetTouches
option< array< touch > >
changedTouches
option< array< touch > >

touchInit

type touchInit = {
mutable identifier: int,
mutable target: WebAPI.EventAPI.eventTarget,
mutable clientX?: float,
mutable clientY?: float,
mutable screenX?: float,
mutable screenY?: float,
mutable pageX?: float,
mutable pageY?: float,
mutable radiusX?: float,
mutable radiusY?: float,
mutable rotationAngle?: float,
mutable force?: float,
mutable altitudeAngle?: float,
mutable azimuthAngle?: float,
mutable touchType?: touchType,
}

Record fields

identifier
int
clientX
option< float >
clientY
option< float >
screenX
option< float >
screenY
option< float >
pageX
option< float >
pageY
option< float >
radiusX
option< float >
radiusY
option< float >
rotationAngle
option< float >
force
option< float >
altitudeAngle
option< float >
azimuthAngle
option< float >
touchType
option< touchType >

touchList

A list of contact points on a touch surface. For example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding TouchList object would have one Touch object for each finger, for a total of three entries. See TouchList on MDN

type touchList = {length: int}

Record fields

length
int

Module

There are methods and helpers defined in TouchList .

touchType

type touchType = @as("direct") Direct | @as("stylus") Stylus

uiEvent

Simple user interface events. See UIEvent on MDN

type uiEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int

uiEventInit

type uiEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >

wheelEvent

Events that occur due to the user moving a mouse wheel or similar input device. See WheelEvent on MDN

type wheelEvent = {
type_: WebAPI.EventAPI.eventType,
target: Null.t<WebAPI.EventAPI.eventTarget>,
currentTarget: Null.t<WebAPI.EventAPI.eventTarget>,
eventPhase: int,
bubbles: bool,
cancelable: bool,
defaultPrevented: bool,
composed: bool,
isTrusted: bool,
timeStamp: float,
view: Null.t<WebAPI.DOMAPI.window>,
detail: int,
screenX: int,
screenY: int,
clientX: int,
clientY: int,
layerX: int,
layerY: int,
ctrlKey: bool,
shiftKey: bool,
altKey: bool,
metaKey: bool,
button: int,
buttons: int,
relatedTarget: Null.t<WebAPI.EventAPI.eventTarget>,
pageX: float,
pageY: float,
x: float,
y: float,
offsetX: float,
offsetY: float,
movementX: float,
movementY: float,
deltaX: float,
deltaY: float,
deltaZ: float,
deltaMode: int,
}

Record fields

type_

Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN

target

Returns the object to which event is dispatched (its target). Read more on MDN

currentTarget

Returns the object whose event listener's callback is currently being invoked. Read more on MDN

eventPhase
int

Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN

bubbles
bool

Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN

cancelable
bool

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN

defaultPrevented
bool

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN

composed
bool

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN

isTrusted
bool

Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN

timeStamp
float

Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN

detail
int
screenX
int
screenY
int
clientX
int
clientY
int
layerX
int
layerY
int
ctrlKey
bool
shiftKey
bool
altKey
bool
metaKey
bool
button
int
buttons
int
pageX
float
pageY
float
offsetX
float
offsetY
float
movementX
float
movementY
float
deltaX
float
deltaY
float
deltaZ
float
deltaMode
int

Module

There are methods and helpers defined in WheelEvent .

wheelEventInit

type wheelEventInit = {
mutable bubbles?: bool,
mutable cancelable?: bool,
mutable composed?: bool,
mutable view?: Null.t<WebAPI.DOMAPI.window>,
mutable detail?: int,
mutable which?: int,
mutable ctrlKey?: bool,
mutable shiftKey?: bool,
mutable altKey?: bool,
mutable metaKey?: bool,
mutable modifierAltGraph?: bool,
mutable modifierCapsLock?: bool,
mutable modifierFn?: bool,
mutable modifierFnLock?: bool,
mutable modifierHyper?: bool,
mutable modifierNumLock?: bool,
mutable modifierScrollLock?: bool,
mutable modifierSuper?: bool,
mutable modifierSymbol?: bool,
mutable modifierSymbolLock?: bool,
mutable screenX?: int,
mutable screenY?: int,
mutable clientX?: int,
mutable clientY?: int,
mutable button?: int,
mutable buttons?: int,
mutable relatedTarget?: Null.t<
WebAPI.EventAPI.eventTarget,
>,
mutable movementX?: float,
mutable movementY?: float,
mutable deltaX?: float,
mutable deltaY?: float,
mutable deltaZ?: float,
mutable deltaMode?: int,
}

Record fields

bubbles
option< bool >
cancelable
option< bool >
composed
option< bool >
view
option< Null.t< WebAPI.DOMAPI.window > >
detail
option< int >
which
option< int >
ctrlKey
option< bool >
shiftKey
option< bool >
altKey
option< bool >
metaKey
option< bool >
modifierAltGraph
option< bool >
modifierCapsLock
option< bool >
modifierFn
option< bool >
modifierFnLock
option< bool >
modifierHyper
option< bool >
modifierNumLock
option< bool >
modifierScrollLock
option< bool >
modifierSuper
option< bool >
modifierSymbol
option< bool >
modifierSymbolLock
option< bool >
screenX
option< int >
screenY
option< int >
clientX
option< int >
clientY
option< int >
button
option< int >
buttons
option< int >
relatedTarget
option< Null.t< WebAPI.EventAPI.eventTarget > >
movementX
option< float >
movementY
option< float >
deltaX
option< float >
deltaY
option< float >
deltaZ
option< float >
deltaMode
option< int >