UIEvent

The UIEvent interface represents simple user interface events.

UIEvent derives from Event. Although the UIEvent.initUIEvent() method is kept for backward compatibility, you should create a UIEvent object using the UIEvent() constructor.

Several interfaces are direct or indirect descendants of this one: MouseEvent, TouchEvent, FocusEvent, KeyboardEvent, WheelEvent, InputEvent, and CompositionEvent.

Constructors

UIEvent()
Creates a UIEvent object.

Properties

This interface also inherits properties of its parent, Event.

UIEvent.detailRead only
Returns a long with details about the event, depending on the event type.
UIEvent.isChar This deprecated API should no longer be used, but will probably still work. Read only
Returns a Boolean indicating whether the event produced a key character or not.
UIEvent.layerX This API has not been standardized. Read only
Returns the horizontal coordinate of the event relative to the current layer.
UIEvent.layerY This API has not been standardized. Read only
Returns the vertical coordinate of the event relative to the current layer.
UIEvent.pageX This API has not been standardized. Read only
Returns the horizontal coordinate of the event relative to the whole document.
UIEvent.pageY This API has not been standardized. Read only
Returns the vertical coordinate of the event relative to the whole document.
UIEvent.sourceCapabilities This is an experimental API that should not be used in production code. Read only
Returns an instance of the InputDeviceCapabilities interface, which provides information about the physical device responsible for generating a touch event.
UIEvent.viewRead only
Returns a WindowProxy that contains the view that generated the event.
UIEvent.which This deprecated API should no longer be used, but will probably still work. This API has not been standardized. Read only
Returns the numeric keyCode of the key pressed, or the character code (charCode) for an alphanumeric key pressed.

Methods

This interface also inherits methods of its parent, Event.

UIEvent.initUIEvent() This deprecated API should no longer be used, but will probably still work.
Initializes a UIEvent object. If the event has already being dispatched, this method does nothing.

Specifications

Specification Status Comment
InputDeviceCapabilities Draft Added sourceCapabilities property.
UI Events Working Draft Extend DOM3
Document Object Model (DOM) Level 3 Events Specification
The definition of 'UIEvent' in that specification.
Obsolete Added the UIEvent() constructor, deprecated the initUIEvent() method and changed the type of view from AbstractView to WindowProxy.
Document Object Model (DOM) Level 2 Events Specification
The definition of 'UIEvent' in that specification.
Obsolete Initial definition

Browser compatibility

BCD tables only load in the browser

See also