WithEvents

interface WithEvents<out T : EventTarget>

Contains all javascript event types. Take a look here.

Sometimes it is necessary to use a more generic type (like Event) because the type that is offered to the listener is not always consistent (on different browsers, different actions, etc.)

Functions

Link copied to clipboard
abstract fun <X : Event> subscribe(name: String): Listener<X, T>

Creates an Listener for the given event name.

Properties

Link copied to clipboard
open val aborts: Listener<Event, T>

occurs when the loading of a media is aborted

Link copied to clipboard
open val afterprints: Listener<Event, T>

occurs when a page has started printing, or if the print dialogue box has been closed

Link copied to clipboard
open val beforeprints: Listener<Event, T>

occurs when a page is about to be printed

Link copied to clipboard
open val beforeunloads: Listener<Event, T>

occurs before the document is about to be unloaded

Link copied to clipboard
open val blurs: Listener<FocusEvent, T>

occurs when an element loses focus

Link copied to clipboard
open val canplays: Listener<Event, T>

occurs when the browser can start playing the media (when it has buffered enough to begin)

Link copied to clipboard
open val canplaythroughs: Listener<Event, T>

occurs when the browser can play through the media without stopping for buffering

Link copied to clipboard
open val changes: Listener<Event, T>

occurs when the content of a form element, the selection, or the checked state have changed (for <input>, <select>, and <textarea>)

Link copied to clipboard
open val clicks: Listener<MouseEvent, T>

occurs when the user clicks on an element

Link copied to clipboard
open val contextmenus: Listener<MouseEvent, T>

occurs when the user right-clicks on an element to open a context menu

Link copied to clipboard
open val copys: Listener<ClipboardEvent, T>

occurs when the user copies the content of an element

Link copied to clipboard
open val cuts: Listener<ClipboardEvent, T>

occurs when the user cuts the content of an element

Link copied to clipboard
open val dblclicks: Listener<MouseEvent, T>

occurs when the user double-clicks on an element

Link copied to clipboard
open val dragends: Listener<DragEvent, T>

occurs when the user has finished dragging an element

Link copied to clipboard
open val dragenters: Listener<DragEvent, T>

occurs when the dragged element enters the drop target

Link copied to clipboard
open val dragleaves: Listener<DragEvent, T>

occurs when the dragged element leaves the drop target

Link copied to clipboard
open val dragovers: Listener<DragEvent, T>

occurs when the dragged element is over the drop target

Link copied to clipboard
open val drags: Listener<DragEvent, T>

occurs when an element is being dragged

Link copied to clipboard
open val dragstarts: Listener<DragEvent, T>

occurs when the user starts to drag an element

Link copied to clipboard
open val drops: Listener<DragEvent, T>

occurs when the dragged element is dropped on the drop target

Link copied to clipboard
open val durationchanges: Listener<Event, T>

occurs when the duration of the media is changed

Link copied to clipboard
open val endeds: Listener<Event, T>

occurs when the media has reach the end (useful for messages like "thanks for listening")

Link copied to clipboard
open val focusins: Listener<FocusEvent, T>

occurs when an element is about to get focus

Link copied to clipboard
open val focusouts: Listener<FocusEvent, T>

occurs when an element is about to lose focus

Link copied to clipboard
open val focuss: Listener<FocusEvent, T>

occurs when an element gets focus

Link copied to clipboard
open val fullscreenchanges: Listener<Event, T>

occurs when an element is displayed in fullscreen mode

Link copied to clipboard
open val fullscreenerrors: Listener<Event, T>

occurs when an element can not be displayed in fullscreen mode

Link copied to clipboard
open val hashchanges: Listener<HashChangeEvent, T>

occurs when there has been changes to the anchor part of a URL

Link copied to clipboard
open val inputs: Listener<Event, T>

occurs when an element gets user input has to use Event as type because Chrome and Safari offer Events instead of InputEvents when selecting from a datalist

Link copied to clipboard
open val invalids: Listener<Event, T>

occurs when an element is invalid

Link copied to clipboard
open val keydowns: Listener<KeyboardEvent, T>

occurs when the user is pressing a key

Link copied to clipboard
open val keypresss: Listener<KeyboardEvent, T>

occurs when the user presses a key

Link copied to clipboard
open val keyups: Listener<KeyboardEvent, T>

occurs when the user releases a key

Link copied to clipboard
open val loadeddatas: Listener<Event, T>

occurs when media data is loaded

Link copied to clipboard
open val loadedmetadatas: Listener<Event, T>

occurs when metadata (like dimensions and duration) are loaded

Link copied to clipboard
open val loads: Listener<Event, T>

occurs when an object has loaded

Link copied to clipboard
open val loadstarts: Listener<ProgressEvent, T>

occurs when the browser starts looking for the specified media

Link copied to clipboard
open val messages: Listener<Event, T>

occurs when a message is received through the event source

Link copied to clipboard
open val mousedowns: Listener<MouseEvent, T>

occurs when the user presses a mouse button over an element

Link copied to clipboard
open val mouseenters: Listener<MouseEvent, T>

occurs when the pointer is moved onto an element

Link copied to clipboard
open val mouseleaves: Listener<MouseEvent, T>

occurs when the pointer is moved out of an element

Link copied to clipboard
open val mousemoves: Listener<MouseEvent, T>

occurs when the pointer is moving while it is over an element

Link copied to clipboard
open val mouseouts: Listener<MouseEvent, T>

occurs when a user moves the mouse pointer out of an element, or out of one of its children

Link copied to clipboard
open val mouseovers: Listener<MouseEvent, T>

occurs when the pointer is moved onto an element, or onto one of its children

Link copied to clipboard
open val mouseups: Listener<MouseEvent, T>

occurs when a user releases a mouse button over an element

Link copied to clipboard
open val offlines: Listener<Event, T>

occurs when the browser starts to work offline

Link copied to clipboard
open val onlines: Listener<Event, T>

occurs when the browser starts to work online

Link copied to clipboard
open val opens: Listener<Event, T>

occurs when a connection with the event source is opened

Link copied to clipboard
open val pagehides: Listener<PageTransitionEvent, T>

occurs when the user navigates away from a webpage

Link copied to clipboard
open val pageshows: Listener<PageTransitionEvent, T>

occurs when the user navigates to a webpage

Link copied to clipboard
open val pastes: Listener<ClipboardEvent, T>

occurs when the user pastes some content in an element

Link copied to clipboard
open val pauses: Listener<Event, T>

occurs when the media is paused either by the user or programmatically

Link copied to clipboard
open val playings: Listener<Event, T>

occurs when the media is playing after having been paused or stopped for buffering

Link copied to clipboard
open val plays: Listener<Event, T>

occurs when the media has been started or is no longer paused

Link copied to clipboard
open val popstates: Listener<PopStateEvent, T>

occurs when the window's history changes

Link copied to clipboard
open val progresss: Listener<Event, T>

occurs when the browser is in the process of getting the media data (downloading the media)

Link copied to clipboard
open val ratechanges: Listener<Event, T>

occurs when the playing speed of the media is changed

Link copied to clipboard
open val resets: Listener<Event, T>

occurs when a form is reset

Link copied to clipboard
open val resizes: Listener<Event, T>

occurs when the document view is resized

Link copied to clipboard
open val scrolls: Listener<Event, T>

occurs when an element's scrollbar is being scrolled

Link copied to clipboard
open val searchs: Listener<Event, T>

occurs when the user writes something in a search field (for )

Link copied to clipboard
open val seekeds: Listener<Event, T>

occurs when the user is finished moving/skipping to a new position in the media

Link copied to clipboard
open val seekings: Listener<Event, T>

occurs when the user starts moving/skipping to a new position in the media

Link copied to clipboard
open val selects: Listener<Event, T>

occurs after the user selects some text (for and

Link copied to clipboard
open val shows: Listener<Event, T>

occurs when a

element is shown as a context menu

Link copied to clipboard
open val stalleds: Listener<Event, T>

occurs when the browser is trying to get media data, but data is not available

Link copied to clipboard
open val storages: Listener<StorageEvent, T>

occurs when a Web Storage area is updated

Link copied to clipboard
open val submits: Listener<Event, T>

occurs when a form is submitted

Link copied to clipboard
open val suspends: Listener<Event, T>

occurs when the browser is intentionally not getting media data

Link copied to clipboard
open val timeupdates: Listener<Event, T>

occurs when the playing position has changed (like when the user fast forwards to a different point in the media)

Link copied to clipboard
open val toggles: Listener<Event, T>

occurs when the user opens or closes the

element

Link copied to clipboard
open val touchcancels: Listener<TouchEvent, T>

occurs when the touch is interrupted

Link copied to clipboard
open val touchends: Listener<TouchEvent, T>

occurs when a finger is removed from a touch screen

Link copied to clipboard
open val touchmoves: Listener<TouchEvent, T>

occurs when a finger is dragged across the screen

Link copied to clipboard
open val touchstarts: Listener<TouchEvent, T>

occurs when a finger is placed on a touch screen

Link copied to clipboard
open val unloads: Listener<Event, T>

occurs once a page has unloaded (for )

Link copied to clipboard
open val volumechanges: Listener<Event, T>

occurs when the volume of the media has changed (includes setting the volume to "mute")

Link copied to clipboard
open val waitings: Listener<Event, T>

occurs when the media has paused but is expected to resume (like when the media pauses to buffer more data)

Link copied to clipboard
open val wheels: Listener<WheelEvent, T>

occurs when the mouse wheel rolls up or down over an element

Inheritors

Link copied to clipboard
Link copied to clipboard