Class glow.events.DomEvent
Extends
glow.events.Event.
Defined in: core.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
glow.events.DomEvent(nativeEvent, properties)
Describes a DOM event that occurred
You don't need to create instances of this class if you're simply
listening to events.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Was the alt key pressed during the event?
|
|
|
A number representing which button was pressed.
|
|
|
Was the ctrl key pressed during the event?
|
|
|
The horizontal position of the mouse pointer in the page in pixels.
|
|
|
The vertical position of the mouse pointer in the page in pixels.
|
|
|
The native event object provided by the browser.
|
|
|
A related HTMLElement
For mouseover / mouseenter events, this will refer to the previous element
the mouse was over.
|
|
|
Was the shift key pressed during the event?
|
|
|
The element that the event originated from.
|
|
|
The native type of the event, like 'click' or 'keydown'.
|
|
|
The number of clicks the mouse wheel moved.
|
- Fields borrowed from class glow.events.Event:
- attachedTo
- Methods borrowed from class glow.events.Event:
- defaultPrevented, preventDefault
Class Detail
glow.events.DomEvent(nativeEvent, properties)
Describes a DOM event that occurred
You don't need to create instances of this class if you're simply
listening to events. One will be provided as the first argument
in your callback.
- Parameters:
- {Event|string} nativeEvent
- A native browser event read properties from, or the name of a native event.
- {Object} properties Optional
- Properties to add to the Event instance. Each key-value pair in the object will be added to the Event as properties
Field Detail
altKey
Was the alt key pressed during the event?
button
A number representing which button was pressed.
0 for the left button, 1 for the middle button or 2 for the right button.
ctrlKey
Was the ctrl key pressed during the event?
mouseLeft
The horizontal position of the mouse pointer in the page in pixels.
mouseTop
The vertical position of the mouse pointer in the page in pixels.
nativeEvent
The native event object provided by the browser.
related
A related HTMLElement
For mouseover / mouseenter events, this will refer to the previous element
the mouse was over.
For mouseout / mouseleave events, this will refer to the element the mouse
is now over.
shiftKey
Was the shift key pressed during the event?
source
The element that the event originated from.
For example, you could attach a listener to an
- element to listen for
clicks. If the user clicked on an
- the source property would be the
- element, and {@link glow.DomEvent#attachedTo attachedTo} would be
the
- .
type
The native type of the event, like 'click' or 'keydown'.
wheelData
The number of clicks the mouse wheel moved.
Up values are positive, down values are negative.