goog.events.KeyEvent
Provided By | |
---|---|
Extends |
This class is used for the goog.events.KeyEvent.EventType.KEY event and it overrides the key code with the fixed key code.
new KeyEvent( keyCode, charCode, repeat, browserEvent )
Parameters |
|
---|
Instance Methods
this.getBrowserEvent() → (Event|null)
(Event|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.hasPropagationStopped() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.init( e, opt_currentTarget ) → void
void
Accepts a browser event object and creates a patched, cross browser event object.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.isButton( button ) → boolean
boolean
Tests to see which button was pressed during the event. This is really only useful in IE and Gecko browsers. And in IE, it's only useful for mousedown/mouseup events, because click only fires for the left mouse button.
Safari 2 only reports the left button being clicked, and uses the value '1' instead of 0. Opera only reports a mousedown event for the middle button, and no mouse events for the right button. Opera has default behavior for left and middle click that can only be overridden via a configuration setting.
There's a nice table of this mess at http://www.unixpapa.com/js/mouse.html.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.isMouseActionButton() → boolean
boolean
Whether this has an "action"-producing mouse button.
By definition, this includes left-click on windows/linux, and left-click without the ctrl key on Macs.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.preventDefault() → void
void
Prevents the default action, for example a link redirecting to a url.
Defined by | |
---|---|
Overrides | |
Parameters | None. |
this.stopPropagation() → void
void
Stops event propagation.
Defined by | |
---|---|
Overrides | |
Parameters | None. |
Instance Properties
this.altKey → boolean
boolean
Whether alt was pressed at time of event.
this.button → number
number
Which mouse button was pressed.
this.charCode → number
number
this.clientX → number
number
X-coordinate relative to the window.
this.clientY → number
number
Y-coordinate relative to the window.
this.ctrlKey → boolean
boolean
Whether control was pressed at time of event.
this.currentTarget → (Node|null|undefined)
(Node|null|undefined)
Node that had the listener attached.
Defined by | |
---|---|
Overrides |
this.defaultPrevented → boolean
boolean
Whether the default action has been prevented.
This is a property to match the W3C specification at
#events-event-type-defaultPrevented
.
Must be treated as read-only outside the class.
this.key → string
string
Key of key press.
this.keyCode → number
number
this.metaKey → boolean
boolean
Whether the meta key was pressed at time of event.
this.offsetX → number
number
X-coordinate relative to target.
this.offsetY → number
number
Y-coordinate relative to target.
this.platformModifierKey → boolean
boolean
Whether the default platform modifier key was pressed at time of event. (This is control for all platforms except Mac, where it's Meta.)
this.pointerId → number
number
No information.
this.pointerType → string
string
No information.
this.relatedTarget → (Node|null)
(Node|null)
For mouseover and mouseout events, the related object for the event.
this.repeat → boolean
boolean
True if this event was generated by keyboard auto-repeat (i.e., the user is holding the key down.)
this.row → ?
?
No information.
this.rowNode → (Element|null|undefined)
(Element|null|undefined)
No information.
this.screenX → number
number
X-coordinate relative to the monitor.
this.screenY → number
number
Y-coordinate relative to the monitor.
this.shiftKey → boolean
boolean
Whether shift was pressed at time of event.
this.state → (Object|null)
(Object|null)
History state object, only set for PopState events where it's a copy of the state object provided to pushState or replaceState.
this.target → (Node|null)
(Node|null)
Target that fired the event.
Defined by | |
---|---|
Overrides |
this.type → string
string
Event type.