@haxall/haxall
    Preparing search index...

    Class Event

    Event models the DOM event object.

    Common event types:

    "mousedown"   Fired when a mouse button is pressed on an element.

    "mouseup" Fired when a mouse button is released over an element.

    "click" Fired when a mouse button is pressed and released on a
    single element.

    "dblclick" Fired when a mouse button is clicked twice on a single element.

    "mousemove" Fired when a mouse is moved while over an element.

    "mouseover" Fired when mouse is moved onto the element that has the
    listener attached or onto one of its children.

    "mouseout" Fired when mouse is moved off the element that has the
    listener attached or off one of its children.

    "mouseenter" Fired when mouse is moved over the element that has the
    listener attached. Similar to '"mouseover"', it differs in
    that it doesn't bubble and that it isn't sent when the mouse
    is moved from one of its descendants' physical space to its
    own physical space.

    With deep hierarchies, the amount of mouseenter events sent
    can be quite huge and cause significant performance problems.
    In such cases, it is better to listen for "mouseover" events.

    "mouseleave" Fired when mouse is moved off the element that has the
    listener attached. Similar to "mouseout", it differs in that
    it doesn't bubble and that it isn't sent until the pointer
    has moved from its physical space and the one of all its
    descendants.

    With deep hierarchies, the amount of mouseleave events sent
    can be quite huge and cause significant performance problems.
    In such cases, it is better to listen for "mouseout" events.

    "contextmenu" Fired when the right button of the mouse is clicked (before
    the context menu is displayed), or when the context menu key
    is pressed (in which case the context menu is displayed at the
    bottom left of the focused element, unless the element is a
    tree, in which case the context menu is displayed at the
    bottom left of the current row).


    "focus" The focus event is fired when an element has received focus

    "blur" The blur event is fired when an element has lost focus.

    "keydown" Fired when a key is pressed down.

    "keyup" Fired when a key is released.

    "keypress" Fired when a key is pressed down and that key normally
    produces a character value (use "input" instead).

    "input" Fired synchronously when the value of an <input> or
    <textarea> element is changed.

    "dragstart" Fired on an element when a drag is started. The user is
    requesting to drag the element where the dragstart event is
    fired. During this event, a listener would set information
    such as the drag data and image to be associated with the drag.
    This event is not fired when dragging a file into the browser
    from the OS.

    "dragenter" Fired when the mouse enters an element while a drag is
    occurring. A listener for this event should indicate whether
    a drop is allowed over this location. If there are no listeners,
    or the listeners perform no operations, then a drop is not
    allowed by default. This is also the event to listen for in
    order to provide feedback that a drop is allowed, such as
    displaying a highlight or insertion marker.

    "dragover" This event is fired as the mouse is moving over an element
    when a drag is occurring. Much of the time, the operation that
    occurs during a listener will be the same as the "dragenter"
    event.

    "dragleave" This event is fired when the mouse leaves an element while a
    drag is occurring. Listeners should remove any highlighting
    or insertion markers used for drop feedback.

    "drag" This event is fired at the source of the drag and is the element
    where "dragstart" was fired during the drag operation.

    "drop" The drop event is fired on the element where the drop
    occurred at the end of the drag operation. A listener would
    be responsible for retrieving the data being dragged and
    inserting it at the drop location. This event will only fire
    if a drop is desired. It will not fire if the user cancelled
    the drag operation, for example by pressing the Escape key,
    or if the mouse button was released while the mouse was not
    over a valid drop target.

    "dragend" The source of the drag will receive a "dragend" event when the
    drag operation is complete, whether it was successful or not.
    This event is not fired when dragging a file into the browser
    from the OS.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Return true if the ALT key was pressed during the event.

      Returns boolean

    • Mouse button number pressed.

      Returns number

    • Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:

      this < that   =>  <0
      this == that => 0
      this > that => >0

      This method may also be accessed via the < <= <=> >= and > shortcut operators. If not overridden the default implementation compares the toStr representations. Also see docLang.

      Examples:

      3.compare(8)  =>  -1
      8.compare(3) => 1
      8.compare(8) => 0
      3 <=> 8 => -1 // shortcut for 3.compare(8)

      Parameters

      Returns number

    • Return true if the CTRL key was pressed during the event.

      Returns boolean

    • The DataTransfer object for this event.

      Returns DataTransfer

    • Scroll amount for wheel events.

      Returns Point

    • Compare this object to the specified for equality. This method may be accessed via the == and != shortcut operators. If not overridden the default implementation compares for reference equality using the === operator. If this method is overridden, then hash() must also be overridden such that any two objects which return true for equals() must return the same value for hash(). This method must accept null and return false.

      Parameters

      Returns boolean

    • Err instance if available for window.onerror.

      Returns Err

    • Get an attribute by name. If not found return the specified default value.

      Parameters

      • name: string
      • Optionaldef: JsObj

      Returns JsObj

    • Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.

      Returns number

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • Key instance for key pressed.

      Returns Key

    • Character string for key event that represents text typed. For example Shift + Key.b would return "B".

      Returns string

    • Return true if the Meta key was pressed during the event. On Macs this maps to "command" key. On Windows this maps to "Windows" key.

      Returns boolean

    • The mouse position of this event relative to page.

      Returns Point

    • Optional secondary target depending on event type:

      event     target                relatedTarget
      -------- -------------------- -----------------------------
      blur elem losing focus elem receiving focus (if any)
      focus elem receiving focus elem losing focus (if any)
      focusin elem receiving focus elem losing focus (if any)
      focusout elem losing focus elem receiving focus (if any)

      Returns Elem

    • Set an attribute to the given value.

      Parameters

      Returns void

    • Return true if the SHIFT key was pressed during the event.

      Returns boolean

    • Meta-data for this event instance.

      Returns Map<string, JsObj>

    • Meta-data for this event instance.

      Parameters

      Returns void

    • Stop further propagation of this event.

      Returns void

    • The target to which the event was dispatched.

      Returns Elem

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Get the native JavaScript Event object

      Returns any

    • Return a string representation of this object.

      Returns string

    • Get or set an attribute.

      Parameters

      Returns JsObj

    • The type of this event.

      Returns string

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void

    • Create an Event instance from a native JavaScript Event object.

      Parameters

      • event: any

      Returns Event