goog.events.KeyEvent
Classgoog.events.KeyEvent
> goog.events.BrowserEvent
> goog.events.Event
goog.events.KeyEvent(keyCode, charCode, repeat, browserEvent)
This class is used for the goog.events.KeyHandler.EventType.KEY event and it overrides the key code with the fixed key code.
keyCode
{number
}
charCode
{number
}
repeat
{boolean
}
browserEvent
{Event
}
.altKey
{boolean
}Inherited from goog.events.BrowserEvent
.
Whether alt was pressed at time of event.
.button
{number
}Inherited from goog.events.BrowserEvent
.
Which mouse button was pressed.
.charCode
{number
}Inherited from goog.events.BrowserEvent
.
Keycode of key press.
.clientX
{number
}Inherited from goog.events.BrowserEvent
.
X-coordinate relative to the window.
.clientY
{number
}Inherited from goog.events.BrowserEvent
.
Y-coordinate relative to the window.
.ctrlKey
{boolean
}Inherited from goog.events.BrowserEvent
.
Whether control was pressed at time of event.
.currentTarget
{Node
|undefined
}Inherited from goog.events.BrowserEvent
.
Node that had the listener attached.
.defaultPrevented
{boolean
}Inherited from goog.events.Event
.
Whether the default action has been prevented. This is a property to match the W3C specification at {@link http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-defaultPrevented}. Must be treated as read-only outside the class.
.dispose()
[deprecated]Deprecated. Events don't need to be disposed.
Inherited from goog.events.Event
.
For backwards compatibility (goog.events.Event used to inherit goog.Disposable).
.disposeInternal()
[deprecated]Deprecated. Events don't need to be disposed.
Inherited from goog.events.BrowserEvent
.
For backwards compatibility (goog.events.Event used to inherit goog.Disposable).
.getBrowserEvent()
Inherited from goog.events.BrowserEvent
.
Event
}
.init(e, opt_currentTarget)
Inherited from goog.events.BrowserEvent
.
Accepts a browser event object and creates a patched, cross browser event object.
e
{Event
}
opt_currentTarget
{Node
=}
.isButton(button)
Inherited from goog.events.BrowserEvent
.
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.
button
{goog.events.BrowserEvent.MouseButton
}
boolean
}
.isMouseActionButton()
Inherited from goog.events.BrowserEvent
.
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.
boolean
}
.keyCode
{number
}Inherited from goog.events.BrowserEvent
.
Keycode of key press.
.metaKey
{boolean
}Inherited from goog.events.BrowserEvent
.
Whether the meta key was pressed at time of event.
.offsetX
{number
}Inherited from goog.events.BrowserEvent
.
X-coordinate relative to target.
.offsetY
{number
}Inherited from goog.events.BrowserEvent
.
Y-coordinate relative to target.
.platformModifierKey
{boolean
}Inherited from goog.events.BrowserEvent
.
Whether the default platform modifier key was pressed at time of event. (This is control for all platforms except Mac, where it's Meta.
.preventDefault()
Inherited from goog.events.BrowserEvent
.
Prevents the default action, for example a link redirecting to a url.
.propagationStopped_
{boolean
}Inherited from goog.events.Event
.
Whether to cancel the event in internal capture/bubble processing for IE.
.relatedTarget
{Node
}Inherited from goog.events.BrowserEvent
.
For mouseover and mouseout events, the related object for the event.
.repeat
{boolean
}True if this event was generated by keyboard auto-repeat (i.e., the user is holding the key down.)
.returnValue_
{boolean
}Inherited from goog.events.Event
.
Return value for in internal capture/bubble processing for IE.
.screenX
{number
}Inherited from goog.events.BrowserEvent
.
X-coordinate relative to the monitor.
.screenY
{number
}Inherited from goog.events.BrowserEvent
.
Y-coordinate relative to the monitor.
.shiftKey
{boolean
}Inherited from goog.events.BrowserEvent
.
Whether shift was pressed at time of event.
.state
{Object
}Inherited from goog.events.BrowserEvent
.
History state object, only set for PopState events where it's a copy of the state object provided to pushState or replaceState.
.stopPropagation()
Inherited from goog.events.BrowserEvent
.
Stops event propagation.
.target
{Node
}Inherited from goog.events.BrowserEvent
.
Target that fired the event.