package quill

  1. Overview
  2. Docs

Module Brr_ext.EvSource

include module type of struct include Brr.Ev end

Event types

Sourcetype 'a type' = 'a Brr.Ev.type'

The type for events which can pose as values of type 'a. See the predefined event types.

Sourcemodule Type = Brr.Ev.Type

Event types.

The type for events that do not expose further data.

Events

Sourcetype target = Brr.Ev.target

The type for EventTarget abiding objects.

Sourcetype init = Brr.Ev.init

The type for event initialisation objects.

Sourceval init : ?bubbles:bool -> ?cancelable:bool -> ?composed:bool -> unit -> init

init is an event initialisation object with given parameters.

Sourcetype 'a t = 'a Brr.Ev.t

The type for Event objects which can pose as events of type 'a.

Sourcetype 'a event = 'a Brr.Ev.event

See t.

Sourceval create : ?init:init -> 'a type' -> 'a t

create ?init t is an event of type t initialised with init.

Sourceval as_type : 'a t -> 'a

as_type e specialises the event to its type.

Sourceval type' : 'a t -> 'a type'

type' e is the type of e.

Sourceval target : 'a t -> target

target e is the target on which e was originally dispatched.

Sourceval current_target : 'a t -> target

current_target e is the target currently handling e. See also target.

Sourceval composed_path : 'a t -> target list

composed_path e are the targets on which listeners will be invoked.

Sourceval event_phase : 'a t -> [ `None | `Capturing | `At_target | `Bubbling ]

event_phase e is e's event phase, see here for details. This picture may help.

Sourceval bubbles : 'a t -> bool

bubbles e is true whether the event can bubble up through the DOM.

Sourceval stop_propagation : 'a t -> unit

stop_propagation e prevents the propagation of e in the DOM, remaining handlers of e on the current_target are still invoked use stop_immediate_propagation to stop these. The user agent's default action for e still occurs, use prevent_default to prevent that.

Sourceval stop_immediate_propagation : 'a t -> unit

stop_immediate_propagation e is like stop_propagation but it also prevents the invocation of other handlers for e that may be listening on the current_target.

Sourceval cancelable : 'a t -> bool

cancelable e indicates whether e can be cancelled, that is whether prevent_default will succeed.

Sourceval prevent_default : 'a t -> unit

prevent_default e prevents the user agent's default action for e to happen. This may have no effect if cancelable is false, see default_prevented.

Sourceval default_prevented : 'a t -> bool

default_prevented e is true indicates whether a call to prevent_default succeded.

Sourceval composed : 'a t -> bool

composed e is the composed property of e.

Sourceval is_trusted : 'a t -> bool

is_trusted e is true if e was dispatched by the user agent and false otherwise.

Sourceval timestamp_ms : 'a t -> float

timestamp_ms e is the time in milleseconds since the POSIX epoch when the event was created.

Sourceval dispatch : 'a t -> target -> bool

dispatch e t dispatches event e on target t.

Listening

Sourcetype listen_opts = Brr.Ev.listen_opts

The type for listening options.

Sourceval listen_opts : ?capture:bool -> ?once:bool -> ?passive:bool -> unit -> listen_opts

listen_opts () are options for listen.

  • capture indicates if events are listened before being dispatched to descendents of the target in the DOM tree. Defaults to false.
  • once indicates at most a single event will be listened. If true the listener is automatically removed when invoked. Defaults to false.
  • passive indicates the listener never calls prevent_default on the event. If it does nothing will happen (except maybe a console warning). Defaults to false.
Sourcetype listener = Brr.Ev.listener

The type for event listeners. See listen.

Sourceval listen : ?opts:listen_opts -> 'a type' -> ('a t -> unit) -> target -> listener

listen ~opts type' f t is a listener listening for events of type type' on target t with function f and options opts (see listen_opts for defaults). The listener can be used to unlisten, if you don't need to, you can just `ignore` the result.

Sourceval unlisten : listener -> unit

unlisten l stops the listening done by l.

Sourceval next : ?capture:bool -> 'a type' -> target -> 'a t Fut.t

next type' t is a future that determines the next event of type type' on target t. For capture see listen_opts.

Event subobjects

Sourcemodule Data_transfer = Brr.Ev.Data_transfer

DataTransfer objects.

Sourcemodule Clipboard = Brr.Ev.Clipboard

Clipboard events.

Sourcemodule Composition = Brr.Ev.Composition

Composition events.

Sourcemodule Error = Brr.Ev.Error

Error events.

Sourcemodule Extendable = Brr.Ev.Extendable

Extendable events.

Sourcemodule Focus = Brr.Ev.Focus

Focus events.

Sourcemodule Hash_change = Brr.Ev.Hash_change

Hash change events

Sourcemodule Input = Brr.Ev.Input

Input events.

Sourcemodule Keyboard = Brr.Ev.Keyboard

Keyboard events.

Sourcemodule Mouse = Brr.Ev.Mouse

Mouse events.

Sourcemodule Drag = Brr.Ev.Drag

Drag events.

Sourcemodule Pointer = Brr.Ev.Pointer

Pointer events

Sourcemodule Wheel = Brr.Ev.Wheel

Wheel events.

Predefined types

Due to type dependencies some events are defined in their dedicated modules:

Events that have no special type dependencies are defined here, in alphabetic order.

Sourceval abort : void

abort is the type for abort events.

Sourceval activate : Extendable.t type'

activate is the activate event.

Sourceval auxclick : Mouse.t type'

The type for auxclick events.

Sourceval beforeinput : Input.t type'

beforeinput is the beforeinput event.

Sourceval beforeunload : void

beforeunload is the beforeunload event.

Sourceval blur : Focus.t type'

blur is the blur event.

Sourceval canplay : void

canplay is the type for canplay events

Sourceval canplaythrough : void

canplaythrough is the type for canplaythrough events

Sourceval change : void

change is the change event.

Sourceval click : Mouse.t type'

The type for click events.

Sourceval clipboardchange : Clipboard.t type'

change is the clipboardchange event.

Sourceval close : void

close is the type for close events.

Sourceval compositionend : Composition.t type'

compositionstend is the compositionend event.

Sourceval compositionstart : Composition.t type'

compositionstart is the compositionstart event.

Sourceval compositionudpate : Composition.t type'

compositionstupdate is the compositionupdate event.

Sourceval controllerchange : void

controllerchange is the controllerchange event.

copy is the copy event.

cut is the cut event.

Sourceval dblclick : Mouse.t type'

The type for dblclick events.

Sourceval dom_content_loaded : void

dom_content_loaded is the type for DOMContentLoaded_event events.

Sourceval drag : Drag.t type'

drag is the drag event.

Sourceval dragend : Drag.t type'

dragend is the dragend event.

Sourceval dragenter : Drag.t type'

dragenter is the dragenter event.

Sourceval dragexit : Drag.t type'

dragexit is the dragexit event.

Sourceval dragleave : Drag.t type'

dragleave is the dragleave event.

Sourceval dragover : Drag.t type'

dragover is the dragover event.

Sourceval dragstart : Drag.t type'

dragstart is the dragstart event.

Sourceval drop : Drag.t type'

drop is the drop event.

Sourceval durationchange : void

durationchange is the type for durationchange events

Sourceval emptied : void

emptied is the type for emptied events

Sourceval ended : void

ended is the type for ended events

Sourceval error : Error.t type'

error is the type for error events.

Sourceval focus : Focus.t type'

focus is the focus event.

Sourceval focusin : Focus.t type'

focusin is the focusin event.

Sourceval focusout : Focus.t type'

focusout is the focusout event.

Sourceval fullscreenchange : void

fullscreenchange is the fullscreenchange event.

Sourceval fullscreenerror : void

fullscreenerror is the fullscreenerror event.

Sourceval gotpointercapture : Pointer.t type'

gotpointercaputer is the gotpointercapture event.

Sourceval hashchange : Hash_change.t type'

hashchange is the type for hashchange events

Sourceval input : Input.t type'

input is the input event.

install is the install event.

Sourceval keydown : Keyboard.t type'

keydown is the keydown event

keyup is the keyup event

Sourceval languagechange : void

languagechange is the type type for languagechange events.

Sourceval load : void

load is the type for load events.

Sourceval loadeddata : void

loadeddata is the type for loadeddata events

Sourceval loadedmetadata : void

loadedmetadata is the type for loadedmetadata events

Sourceval loadstart : void

loadstart is the type for loadstart events

Sourceval lostpointercapture : Pointer.t type'

lostpointercapture is the lostpointercaptpure event.

Sourceval mousedown : Mouse.t type'

mousedown is the type for mousedown events.

Sourceval mouseenter : Mouse.t type'

mouseenter is the type for mouseenter events.

Sourceval mouseleave : Mouse.t type'

mouseleave is the type for mouseleave events.

Sourceval mousemove : Mouse.t type'

mousemove is the type for mousemove events.

Sourceval mouseout : Mouse.t type'

mouseout is the type for mouseout events.

Sourceval mouseover : Mouse.t type'

mouseover is the type for mouseover events.

Sourceval mouseup : Mouse.t type'

mouseup is the type for mouseup events.

Sourceval open' : void

open' is the type for open events.

paste is the paste event.

Sourceval pause : void

pause is the type for pause events

Sourceval play : void

play is the type for play events

Sourceval playing : void

playing is the type for playing events

Sourceval pointercancel : Pointer.t type'

pointercancel is the pointercancel event.

Sourceval pointerdown : Pointer.t type'

pointerdown is the pointerdown event.

Sourceval pointerenter : Pointer.t type'

pointerneter is the pointerenter event.

Sourceval pointerleave : Pointer.t type'

pointerleave is the pointerleave event.

Sourceval pointerlockchange : void

pointerlockchange is the pointerlockchange event.

Sourceval pointerlockerror : void

pointerlockerror is the pointerlockerror event.

Sourceval pointermove : Pointer.t type'

pointemove is the pointermove event.

Sourceval pointerout : Pointer.t type'

pointerout is the pointerout event.

Sourceval pointerover : Pointer.t type'

pointerover is the pointerover event.

Sourceval pointerrawupdate : Pointer.t type'

pointerrawupdate is the pointerrawupdate event.

Sourceval pointerup : Pointer.t type'

pointerup is the pointerup event.

Sourceval progress : void

progress is the type for progress events

Sourceval ratechange : void

ratechange is the type for ratechange events

Sourceval reset : void

The type for reset events.

Sourceval resize : void

resize is the resize event.

Sourceval scroll : void

scroll is the scroll event.

Sourceval seeked : void

seeked is the type for seeked events

Sourceval seeking : void

seeking is the type for seeking events

Sourceval select : void

select is the type for select events.

Sourceval statechange : void

statechange is the type for statechange events.

Sourceval stalled : void

stalled is the type for stalled events

Sourceval suspend : void

suspend is the type for suspend events

Sourceval timeupdate : void

timeupdate is the type for timeupdate events

Sourceval unload : void

unload is the type for unload events.

Sourceval updatefound : void

updatefound is the type for updatefound events.

Sourceval visibilitychange : void

visibilitychange is the type for visibilitychange events.

Sourceval volumechange : void

volumechange is the type for volumechange events

Sourceval waiting : void

waiting is the type for waiting events

Sourceval wheel : Wheel.t type'

The type for wheel events.

Sourceval selectionchange : void

Event type for the selectionchange event, fired on the document when the current text selection changes.