Module Goog.​Events

module Events : sig..end

class type event = object..end
val event : (Js.js_string Js.t -> event Js.t) Js.constr
type eventType_pre
val of_eventType : eventType -> eventType_pre
module BrowserEvent : sig..end
class type browserEvent = object..end
val browserEvent : 
  (#Dom_html.event Js.t Js.opt ->
   #Dom.node Js.t Js.opt -> browserEvent Js.t)
class type eventTarget = object..end
val eventTarget : eventTarget Js.t Js.constr

This implements the EventTarget interface as defined by W3C DOM 2/3. The main difference from the spec is that the this does not know about event propagation and therefore the flag whether to use bubbling or capturing is not used. Another difference is that event objects do not really have to implement the Event interface. An object is treated as an event object if it has a type property. It also allows you to pass a js_string t instead of an event object and in that case an event like object is created with the type set to the js_string t value. Unless propagation is stopped, events dispatched by an EventTarget bubble to its parent event target, returned by getParentEventTarget. To set the parent event target, call setParentEventTarget or override getParentEventTarget in a subclass. Subclasses that don't support changing the parent event target should override the setter to throw an error.

class type eventHandler = object..end
class type eventWrapper = object..end
val eventHandler : eventHandler Js.t Js.constr

Super class for objects that want to easily manage a number of event listeners. It allows a short cut to listen and also provides a quick way to remove all events listeners belonging to this object. It is optimized to use less objects if only one event is being listened to, but if that's the case, it may not be worth using the EventHandler anyway.

class type keyEvent = object..end
val keyEvent : 
  (int ->
   int -> bool Js.t -> #Dom_html.event Js.t -> keyEvent Js.t)
class type keyHandler = object..end
val keyHandler : 
  ((#Dom_html.element Js.t, #Dom_html.document Js.t) Goog.Tools.Union.t
   Js.opt -> keyHandler Js.t)

A wrapper around an element that you want to listen to keyboard events on.

val listen : 
  (#eventTarget Js.t, #Dom_html.eventTarget Js.t)
  Goog.Tools.Union.t ->
  Js.js_string Js.t ->
  (Dom_html.event Js.t -> unit) Js.callback -> bool Js.t Js.opt -> int

Adds an event listener for a specific event on a DOM Node or an object that has implemented A listener can only be added once to an object and if it is added again the key for the listener is returned. Returns Unique key for the listener.