Expand description
A module containing JavaScript DOM events.
Structs§
- AuxClick
Event - The
AuxClickEvent
event is fired when a non-primary pointing device button (e.g. any non-left mouse button) has been pressed and released on an element. - Before
Unload Event - The
BeforeUnload
event fires when the window is about to be unloaded (to close the page or follow a link). If the event propagation is cancelled, the browser will present the user with a confirmation dialog allowing them to stay on the page or continue. - Blur
Event - The
BlurEvent
is fired when an element has lost focus. The main difference between this event and focusout is that only the latter bubbles. - Change
Event - The
ChangeEvent
is fired for input, select, and textarea elements when a change to the element’s value is committed by the user. Unlike the input event, the change event is not necessarily fired for each change to an element’s value. - Click
Event - The
ClickEvent
is fired when a pointing device button (usually a mouse’s primary button) is pressed and released on a single element. - Context
Menu Event - The
ContextMenuEvent
event is fired when the right button of the mouse is clicked (before the context menu is displayed), or when the context menu key is pressed. - Data
Transfer - The DataTransfer object is used to hold the data that is being dragged during a drag and drop operation.
- Data
Transfer Item - The DataTransferItem object represents 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.
- Data
Transfer Item List - The DataTransferItemList object is 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.
- Double
Click Event - The
DoubleClickEvent
is fired when a pointing device button (usually a mouse’s primary button) is clicked twice on a single element. - Drag
Drop Event - The drop event is fired when an element or text selection is dropped on a valid drop target.
- Drag
EndEvent - The dragend event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).
- Drag
Enter Event - The dragenter event is fired when a dragged element or text selection enters a valid drop target.
- Drag
Event - The drag event is fired every few hundred milliseconds as an element or text selection is being dragged by the user.
- Drag
Exit Event - The dragexit event is fired when an element is no longer the drag operation’s immediate selection target.
- Drag
Leave Event - The dragleave event is fired when a dragged element or text selection leaves a valid drop target.
- Drag
Over Event - The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds).
- Drag
Related Event - A reference to a JavaScript object which implements the IDragEvent interface.
- Drag
Start Event - The dragstart event is fired when the user starts dragging an element or text selection.
- Focus
Event - The
FocusEvent
is fired when an element has received focus. The main difference between this event and focusin is that only the latter bubbles. - Fullscreen
Change Event - The ‘FullscreenChange’ event fires when an element enters or exits fullscreen
- Gamepad
Connected Event - The
GamepadConnected
event is fired on the window object, when the first input is received for a gamepad. - Gamepad
Disconnected Event - The
GamepadDisconnected
event is fired on the window object, when a gamepad is disconnected. - GotPointer
Capture Event - The
GotPointerCaptureEvent
fires when an element receives pointer capture - Hash
Change Event - The
HashChangeEvent
is fired when the fragment identifier of the URL has changed (the part of the URL that follows the # symbol, including the # symbol). - Input
Event - The
InputEvent
is fired synchronously when the value of an input, select, or textarea element is changed. For input elements with type=checkbox or type=radio, the input event should fire when a user toggles the control (via touch, mouse or keyboard) per the HTML5 specification, but historically, this has not been the case. Check compatibility, or attach to the change event instead for elements of these types. - KeyDown
Event - The
KeyDownEvent
is fired when a key is pressed down. Unlike theKeyPressEvent
event it’s also fired for keys which do not produce a character value. - KeyPress
Event - The
KeyPressEvent
is fired when a key is pressed down. It’s only fired for keys which produce a character value. - KeyUp
Event - The
KeyUpEvent
is fired when a key is released. - Load
EndEvent - The
LoadEndEvent
is fired when progress has stopped, e.g. afterProgressErrorEvent
,ProgressAbortEvent
orProgressLoadEvent
have been dispatched. - Load
Start Event - The
LoadStartEvent
is fired when progress has begun. - Lost
Pointer Capture Event - The
LostPointerCaptureEvent
fires when an element loses pointer capture - Mouse
Buttons State - Represents the state of mouse buttons in a
MouseEvent
. - Mouse
Down Event - The
MouseDownEvent
is fired when a pointing device button is pressed on an element. - Mouse
Enter Event - The
MouseEnterEvent
is fired when a pointing device (usually a mouse) is moved over the element that has the listener attached. - Mouse
Leave Event - The
MouseLeaveEvent
is fired when a pointing device (usually a mouse) is moved out of an element that has the listener attached to it. - Mouse
Move Event - The
MouseMoveEvent
is fired when a pointing device (usually a mouse) is moved while over an element. - Mouse
OutEvent - The
MouseOutEvent
is fired when a pointing device (usually a mouse) is moved off the element that has the listener attached or off one of its children. - Mouse
Over Event - The
MouseOverEvent
is fired when a pointing device (usually a mouse) is moved onto the element that has the listener attached or onto one of its children. - Mouse
UpEvent - The
MouseUpEvent
is fired when a pointing device button is released over an element. - Mouse
Wheel Event - The
MouseWheelEvent
is fired when a pointing device’s wheel button (usually a mousewheel) is rotated over the element that has the listener attached. - Pointer
Cancel Event - The
PointerCancelEvent
is fired when a pointer will no longer produce events (for example the device is deactivated), or if the pointer starts a gesture after a pointerdown event (for example panning, zooming, or drag and drop) - Pointer
Down Event - The
PointerDownEvent
is fired when a pointer becomes active - Pointer
Enter Event - The
PointerEnterEvent
is fired when a pointing device is moved into the hit test boundaries of an element or its descendants. This event does not bubble. - Pointer
Leave Event - The
PointerLeaveEvent
is fired when the pointer moves out of the hit test boundaries of an element and it’s descendants. This can include when a finger leaves a touch screen or a pen leaves the detectable hover range. This event does not bubble. - Pointer
Lock Change Event - The
PointerLockChangeEvent
fires when the pointer is locked or unlocked - Pointer
Lock Error Event - The
PointerLockErrorEvent
fires when an error occurs locking a pointer - Pointer
Move Event - The
PointerMoveEvent
is fired when a pointer changes coordinates - Pointer
OutEvent - The
PointerOutEvent
is fired when the pointer moves out of the hit test boundaries of an element. This can include when a finger leaves a touch screen or a pen leaves the detectable hover range. - Pointer
Over Event - The
PointerOverEvent
is fired when a pointing device is moved into a element’s hit test boundaries. - Pointer
UpEvent - The
PointerUpEvent
is fired when a pointer is no longer active - PopState
Event - A
PopStateEvent
is dispatched to the window every time the active history entry changes between two history entries for the same document. If the history entry being activated was created by a call tohistory.push_state()
or was affected by a call tohistory.replace_state()
, thePopStateEvent
’s state property contains a copy of the history entry’s state object. - Progress
Abort Event - The
ProgressAbortEvent
is fired when the progress has been aborted. - Progress
Error Event - The
ProgressErrorEvent
is fired when the progress has failed. - Progress
Event - The
ProgressEvent
is fired to indicate that an operation is in progress. - Progress
Load Event - The
ProgressLoadEvent
is fired when progress has successful finished. - Ready
State Change Event - The readystatechange event is fired when the readyState attribute of a document has changed.
- Resize
Event - The resize event is fired when the document view has been resized.
- Resource
Abort Event - The
ResourceAbortEvent
is fired when the loading of a resource has been aborted. - Resource
Error Event - The
ResourceErrorEvent
is fired when an error occurred; the exact circumstances vary, since this event is used from a variety of APIs. - Resource
Load Event - The
ResourceLoadEvent
is fired when a resource and its dependent resources have finished loading. - Scroll
Event - The scroll event is fired when the document view or an element has been scrolled.
- Selection
Change Event - The selectionchange event of the Selection API is fired when the current text selection on a document is changed.
- Slot
Change Event - The
slotchange
event is fired on an HTMLSlotElement instance (<slot>
element) when the node(s) contained in that slot change. - Socket
Close Event - A SocketCloseEvent is sent to clients using WebSockets when the connection is closed.
- Socket
Error Event - The error event is fired when an error occurred; the exact circumstances vary, events by this name are used from a variety of APIs.
- Socket
Message Event - A message event informs a WebSocket object that a message has been received.
- Socket
Open Event - An open event informs the target that a data connection, has been established.
- Submit
Event - The submit event is fired when a form is submitted.
- Touch
Cancel - The
TouchCancel
event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created). - Touch
End - The
TouchEnd
event is fired when one or more touch points are removed from the touch surface. - Touch
Enter - The
TouchEnter
event is fired when a touch point is moved onto the interactive area of an element. - Touch
Event - A reference to a JavaScript object which implements the ITouchEvent interface.
- Touch
Leave - The
TouchLeave
event is fired when a touch point is moved off the interactive area of an element. - Touch
Move - The
TouchMove
is fired when one or more touch points are moved along the touch surface. - Touch
Start - The
TouchStart
event is fired when one or more touch points are placed on the touch surface. - Unload
Event - The
Unload
event fires when the window has been unloaded and is no longer visible. This event can’t be cancelled.
Enums§
- Data
Transfer Item Kind - The kind of drag data item, string or file.
- Drop
Effect - A DOMString representing the drag operation effect.
- Effect
Allowed - A DOMString representing the drag operation that is allowed.
- Event
Phase - Indicates the phase of event flow during event proessing.
- Keyboard
Location - The location on the keyboard of a key.
- Modifier
Key - A modifier key on the keyboard.
- Mouse
Button - Represents buttons on a mouse during mouse events.
- Mouse
Wheel Delta Mode - What unit of measure the mouse wheel delta is in
- Socket
Message Data - Represents the types of data which can be received on a web socket. Messages
are transmitted tagged as either binary or text: text messages are always
received as strings. Binary messages may be received as either blobs or array
buffers as preferred by the receiver. This choice is indicated via the
binary_type
field on the web socket.
Traits§
- Concrete
Event - A trait representing a concrete event type.
- IDrag
Event - The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element).
- IEvent
- The
IEvent
interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use other interfaces based on the mainIEvent
interface.IEvent
itself contains the properties and methods which are common to all events. - IFocus
Event - The
IFocusEvent
interface represents focus-related events. - IGamepad
Event - A GamepadEvent is fired on the window object, when a gamepad is connected or disconnected to the system.
- IKeyboard
Event IKeyboardEvent
objects describe a user interaction with the keyboard. Each event describes a key; the event type identifies what kind of activity was performed.- IMessage
Event - The MessageEvent interface represents a message received by a target object.
- IMouse
Event - The
IMouseEvent
interface represents events that occur due to the user interacting with a pointing device (such as a mouse). - IPointer
Event - The
IPointerEvent
interface represents 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. - IProgress
Event - The
IProgressEvent
interface represents progress-related events. - ITouch
Event - The
ITouchEvent
interface represents events that occur due to the user interacting with a touch device (such as a phone). - IUiEvent
- The
IUiEvent
interface represents simple user interface events.