Module Brr.Ev
DOM events.
Event types
The type for events which can pose as values of type 'a. See the predefined event types.
module Type : sig ... endEvent types.
type void = Brr.Ev.Type.void Brr.Ev.type'The type for events that do not expose further data.
Events
The type for EventTarget abiding objects.
val init :
?bubbles:bool ->
?cancelable:bool ->
?composed:bool ->
unit ->
Brr.Ev.initinit is an event initialisation object with given parameters.
See t.
val create : ?init:Brr.Ev.init -> 'a Brr.Ev.type' -> 'a Brr.Ev.tcreate ?init t is an event of type t initialised with init.
val as_type : 'a Brr.Ev.t -> 'aas_type e specialises the event to its type.
val type' : 'a Brr.Ev.t -> 'a Brr.Ev.type'type' e is the type of e.
val target : 'a Brr.Ev.t -> Brr.Ev.targettarget e is the target on which e was originally dispatched.
val current_target : 'a Brr.Ev.t -> Brr.Ev.targetcurrent_target e is the target currently handling e. See also target.
val composed_path : 'a Brr.Ev.t -> Brr.Ev.target listcomposed_path e are the targets on which listeners will be invoked.
val event_phase :
'a Brr.Ev.t ->
[ `None | `Capturing | `At_target | `Bubbling ]val bubbles : 'a Brr.Ev.t -> boolbubbles e is true whether the event can bubble up through the DOM.
val stop_propagation : 'a Brr.Ev.t -> unitstop_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.
val stop_immediate_propagation : 'a Brr.Ev.t -> unitstop_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.
val cancelable : 'a Brr.Ev.t -> boolcancelable e indicates whether e can be cancelled, that is whether prevent_default will succeed.
val prevent_default : 'a Brr.Ev.t -> unitprevent_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.
val default_prevented : 'a Brr.Ev.t -> booldefault_prevented e is true indicates whether a call to prevent_default succeded.
val is_trusted : 'a Brr.Ev.t -> boolis_trusted e is true if e was dispatched by the user agent and false otherwise.
val timestamp_ms : 'a Brr.Ev.t -> floattimestamp_ms e is the time in milleseconds since the POSIX epoch when the event was created.
val dispatch : 'a Brr.Ev.t -> Brr.Ev.target -> booldispatch e t dispatches event e on target t.
Listening
val listen_opts :
?capture:bool ->
?once:bool ->
?passive:bool ->
unit ->
Brr.Ev.listen_optslisten_opts () are options for listen.
captureindicates if events are listened before being dispatched to descendents of the target in the DOM tree. Defaults tofalse.onceindicates at most a single event will be listened. Iftruethe listener is automatically removed when invoked. Defaults tofalse.passiveindicates the listener never callsprevent_defaulton the event. If it does nothing will happen (except maybe a console warning). Defaults tofalse.
The type for event listeners. See listen.
val listen :
?opts:Brr.Ev.listen_opts ->
'a Brr.Ev.type' ->
('a Brr.Ev.t -> unit) ->
Brr.Ev.target ->
Brr.Ev.listenerlisten ~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.
val unlisten : Brr.Ev.listener -> unitunlisten l stops the listening done by l.
val next :
?capture:bool ->
'a Brr.Ev.type' ->
Brr.Ev.target ->
'a Brr.Ev.t Fut.tnext type' t is a future that determines the next event of type type' on target t. For capture see listen_opts.
Event subobjects
module Data_transfer : sig ... endDataTransfer objects.
module Clipboard : sig ... endClipboard events.
module Composition : sig ... endComposition events.
module Error : sig ... endError events.
module Extendable : sig ... endExtendable events.
module Focus : sig ... endFocus events.
module Hash_change : sig ... endHash change events
module Input : sig ... endInput events.
module Keyboard : sig ... endKeyboard events.
module Mouse : sig ... endMouse events.
module Drag : sig ... endDrag events.
module Pointer : sig ... endPointer events
module Wheel : sig ... endWheel events.
Predefined types
Due to type dependencies some events are defined in their dedicated modules:
- History events
- Fetch events
- Form events
- Media device events
- Media recorder events
- Media stream events
- Media track events
- Message events
- Notification events
- Storage events
Events that have no special type dependencies are defined here, in alphabetic order.
val abort : Brr.Ev.voidabort is the type for abort events.
val activate : Brr.Ev.Extendable.t Brr.Ev.type'activate is the activate event.
val auxclick : Brr.Ev.Mouse.t Brr.Ev.type'The type for auxclick events.
val beforeinput : Brr.Ev.Input.t Brr.Ev.type'beforeinput is the beforeinput event.
val beforeunload : Brr.Ev.voidbeforeunload is the beforeunload event.
val blur : Brr.Ev.Focus.t Brr.Ev.type'blur is the blur event.
val canplay : Brr.Ev.voidcanplay is the type for canplay events
val canplaythrough : Brr.Ev.voidcanplaythrough is the type for canplaythrough events
val change : Brr.Ev.voidchange is the change event.
val click : Brr.Ev.Mouse.t Brr.Ev.type'The type for click events.
val clipboardchange : Brr.Ev.Clipboard.t Brr.Ev.type'change is the clipboardchange event.
val close : Brr.Ev.voidclose is the type for close events.
val compositionend : Brr.Ev.Composition.t Brr.Ev.type'compositionstend is the compositionend event.
val compositionstart : Brr.Ev.Composition.t Brr.Ev.type'compositionstart is the compositionstart event.
val compositionudpate : Brr.Ev.Composition.t Brr.Ev.type'compositionstupdate is the compositionupdate event.
val controllerchange : Brr.Ev.voidcontrollerchange is the controllerchange event.
val copy : Brr.Ev.Clipboard.t Brr.Ev.type'copy is the copy event.
val cut : Brr.Ev.Clipboard.t Brr.Ev.type'cut is the cut event.
val dblclick : Brr.Ev.Mouse.t Brr.Ev.type'The type for dblclick events.
val dom_content_loaded : Brr.Ev.voiddom_content_loaded is the type for DOMContentLoaded_event events.
val drag : Brr.Ev.Drag.t Brr.Ev.type'drag is the drag event.
val dragend : Brr.Ev.Drag.t Brr.Ev.type'dragend is the dragend event.
val dragenter : Brr.Ev.Drag.t Brr.Ev.type'dragenter is the dragenter event.
val dragexit : Brr.Ev.Drag.t Brr.Ev.type'dragexit is the dragexit event.
val dragleave : Brr.Ev.Drag.t Brr.Ev.type'dragleave is the dragleave event.
val dragover : Brr.Ev.Drag.t Brr.Ev.type'dragover is the dragover event.
val dragstart : Brr.Ev.Drag.t Brr.Ev.type'dragstart is the dragstart event.
val drop : Brr.Ev.Drag.t Brr.Ev.type'drop is the drop event.
val durationchange : Brr.Ev.voiddurationchange is the type for durationchange events
val emptied : Brr.Ev.voidemptied is the type for emptied events
val ended : Brr.Ev.voidended is the type for ended events
val error : Brr.Ev.Error.t Brr.Ev.type'error is the type for error events.
val focus : Brr.Ev.Focus.t Brr.Ev.type'focus is the focus event.
val focusin : Brr.Ev.Focus.t Brr.Ev.type'focusin is the focusin event.
val focusout : Brr.Ev.Focus.t Brr.Ev.type'focusout is the focusout event.
val fullscreenchange : Brr.Ev.voidfullscreenchange is the fullscreenchange event.
val fullscreenerror : Brr.Ev.voidfullscreenerror is the fullscreenerror event.
val gotpointercapture : Brr.Ev.Pointer.t Brr.Ev.type'gotpointercaputer is the gotpointercapture event.
val hashchange : Brr.Ev.Hash_change.t Brr.Ev.type'hashchange is the type for hashchange events
val input : Brr.Ev.Input.t Brr.Ev.type'input is the input event.
val install : Brr.Ev.Extendable.t Brr.Ev.type'install is the install event.
val keydown : Brr.Ev.Keyboard.t Brr.Ev.type'keydown is the keydown event
val keyup : Brr.Ev.Keyboard.t Brr.Ev.type'keyup is the keyup event
val languagechange : Brr.Ev.voidlanguagechange is the type type for languagechange events.
val load : Brr.Ev.voidload is the type for load events.
val loadeddata : Brr.Ev.voidloadeddata is the type for loadeddata events
val loadedmetadata : Brr.Ev.voidloadedmetadata is the type for loadedmetadata events
val loadstart : Brr.Ev.voidloadstart is the type for loadstart events
val lostpointercapture : Brr.Ev.Pointer.t Brr.Ev.type'lostpointercapture is the lostpointercaptpure event.
val mousedown : Brr.Ev.Mouse.t Brr.Ev.type'mousedown is the type for mousedown events.
val mouseenter : Brr.Ev.Mouse.t Brr.Ev.type'mouseenter is the type for mouseenter events.
val mouseleave : Brr.Ev.Mouse.t Brr.Ev.type'mouseleave is the type for mouseleave events.
val mousemove : Brr.Ev.Mouse.t Brr.Ev.type'mousemove is the type for mousemove events.
val mouseout : Brr.Ev.Mouse.t Brr.Ev.type'mouseout is the type for mouseout events.
val mouseover : Brr.Ev.Mouse.t Brr.Ev.type'mouseover is the type for mouseover events.
val mouseup : Brr.Ev.Mouse.t Brr.Ev.type'mouseup is the type for mouseup events.
val open' : Brr.Ev.voidopen' is the type for open events.
val paste : Brr.Ev.Clipboard.t Brr.Ev.type'paste is the paste event.
val pause : Brr.Ev.voidpause is the type for pause events
val play : Brr.Ev.voidplay is the type for play events
val playing : Brr.Ev.voidplaying is the type for playing events
val pointercancel : Brr.Ev.Pointer.t Brr.Ev.type'pointercancel is the pointercancel event.
val pointerdown : Brr.Ev.Pointer.t Brr.Ev.type'pointerdown is the pointerdown event.
val pointerenter : Brr.Ev.Pointer.t Brr.Ev.type'pointerneter is the pointerenter event.
val pointerleave : Brr.Ev.Pointer.t Brr.Ev.type'pointerleave is the pointerleave event.
val pointerlockchange : Brr.Ev.voidpointerlockchange is the pointerlockchange event.
val pointerlockerror : Brr.Ev.voidpointerlockerror is the pointerlockerror event.
val pointermove : Brr.Ev.Pointer.t Brr.Ev.type'pointemove is the pointermove event.
val pointerout : Brr.Ev.Pointer.t Brr.Ev.type'pointerout is the pointerout event.
val pointerover : Brr.Ev.Pointer.t Brr.Ev.type'pointerover is the pointerover event.
val pointerrawupdate : Brr.Ev.Pointer.t Brr.Ev.type'pointerrawupdate is the pointerrawupdate event.
val pointerup : Brr.Ev.Pointer.t Brr.Ev.type'pointerup is the pointerup event.
val progress : Brr.Ev.voidprogress is the type for progress events
val ratechange : Brr.Ev.voidratechange is the type for ratechange events
val reset : Brr.Ev.voidThe type for reset events.
val resize : Brr.Ev.voidresize is the resize event.
val scroll : Brr.Ev.voidscroll is the scroll event.
val seeked : Brr.Ev.voidseeked is the type for seeked events
val seeking : Brr.Ev.voidseeking is the type for seeking events
val select : Brr.Ev.voidselect is the type for select events.
val statechange : Brr.Ev.voidstatechange is the type for statechange events.
val stalled : Brr.Ev.voidstalled is the type for stalled events
val suspend : Brr.Ev.voidsuspend is the type for suspend events
val timeupdate : Brr.Ev.voidtimeupdate is the type for timeupdate events
val unload : Brr.Ev.voidunload is the type for unload events.
val updatefound : Brr.Ev.voidupdatefound is the type for updatefound events.
val visibilitychange : Brr.Ev.voidvisibilitychange is the type for visibilitychange events.
val volumechange : Brr.Ev.voidvolumechange is the type for volumechange events
val waiting : Brr.Ev.voidwaiting is the type for waiting events
val wheel : Brr.Ev.Wheel.t Brr.Ev.type'The type for wheel events.