I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Registrati per tradurlo tu.
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
UIEventobject.
Properties
This interface also inherits properties of its parent, Event.
UIEvent.cancelBubble- Is a
Booleanindicating whether the bubbling of the event has been canceled or not.
UIEvent.detailRead only- Returns a
longwith details about the event, depending on the event type. UIEvent.isCharRead only- Returns a
Booleanindicating whether the event produced a key character or not. UIEvent.layerXRead only- Returns the horizontal coordinate of the event relative to the current layer.
UIEvent.layerYRead only- Returns the vertical coordinate of the event relative to the current layer.
UIEvent.pageXRead only- Returns the horizontal coordinate of the event relative to the whole document.
UIEvent.pageYRead only- Returns the vertical coordinate of the event relative to the whole document.
UIEvent.viewRead only- Returns a
WindowProxythat contains the view that generated the event. UIEvent.whichRead only- Returns the numeric
keyCodeof 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()- Initializes a
UIEventobject. If the event has already being dispatched, this method does nothing.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Document Object Model (DOM) Level 3 Events Specification The definition of 'UIEvent' in that specification. |
Working Draft | From Document Object Model (DOM) Level 2 Events Specification:
|
| Document Object Model (DOM) Level 2 Events Specification The definition of 'UIEvent' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | ? | (Yes) | ? |
UIEvent() |
(Yes) | 11 (11) | ? | (Yes) | ? |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | ? | (Yes) | ? |
UIEvent() |
(Yes) | 11.0 (11) | ? | (Yes) | ? |
See also
Etichette del documento e nomi di chi ha collaborato alla sua stesura
Etichette:
Contributors to this page: douglas-j-bothwell, A.Perez, fscholz, teoli, kscarfone, Sheppy, KYSergey, ziyunfei, Masayuki
Ultima modifica di:
douglas-j-bothwell,

