UIEvent

UIEvent 介面是使用者介面的事件的基本型態。

UIEvent 是從 Event 衍伸過來。 雖然為了相容性,仍留著 UIEvent.initUIEvent() (en-US) 方法,建立 UIEvent 物件最好是選擇以 UIEvent() constructor 建立。

許多介面直接或間接繼承此介面,例如:MouseEvent (en-US)TouchEvent (en-US)FocusEvent (en-US)KeyboardEventWheelEventInputEvent (en-US)CompositionEvent (en-US)

建構式

UIEvent()

建立一個 UIEvent 物件 。

屬性

此介面亦繼承其父-- Event 的屬性:

UIEvent.cancelBubble (en-US) 非標準 已棄用

Is a Boolean indicating whether the bubbling of the event has been canceled or not.

UIEvent.detail (en-US)Read only

Returns a long with details about the event, depending on the event type.

UIEvent.isChar 已棄用 Read only

Returns a Boolean indicating whether the event produced a key character or not.

UIEvent.layerX (en-US) 非標準 Read only

Returns the horizontal coordinate of the event relative to the current layer.

UIEvent.layerY (en-US) 非標準 Read only

Returns the vertical coordinate of the event relative to the current layer.

UIEvent.pageX (en-US) 非標準 Read only

Returns the horizontal coordinate of the event relative to the whole document.

UIEvent.pageY (en-US) 非標準 Read only

Returns the vertical coordinate of the event relative to the whole document.

UIEvent.sourceCapabilities (en-US) 非標準 Read only

Returns an instance of the InputDeviceCapabilities interface which provides information about the physical device responsible for generating a touch event.

UIEvent.view (en-US)Read only

Returns a WindowProxy that contains the view that generated the event.

UIEvent.which (en-US) 非標準 Read only

Returns the numeric keyCode of the key pressed, or the character code (charCode) for an alphanumeric key pressed.

方法

此介面亦繼承其父-- Event 的方法:

UIEvent.initUIEvent() (en-US) 已棄用

初始化 UIEvent 物件。若該事件已經觸發的話,此方法就不會執行任何東西。

規範

Specification
UI Events
# idl-uievent

瀏覽器相容性

BCD tables only load in the browser

參見