events.KeyEvent Extends goog.events.BrowserEvent
This class is used for the goog.events.KeyHandler.EventType.KEY event and it overrides the key code with the fixed key code.

Inheritance

Constructor

goog.events.KeyEvent(keyCodecharCoderepeatbrowserEvent)

Parameters

keyCode :
The adjusted key code.
charCode :
The unicode character code.
repeat :
Whether this event was generated by keyboard repeat.
browserEvent :
(Event | null)
Browser event object.

Instance Methods

Public Protected Private
disposeInternal()
No description.
code »
getBrowserEvent()
(Event | null)
No description.
Returns: 
(Event | null)
  The underlying browser event object.
code »
init(eopt_currentTarget)
Accepts a browser event object and creates a patched, cross browser event object.
Arguments:
e :
(Event | null)
Browser event object.
opt_currentTarget :
(Node | null | undefined)
Current target for event.
code »
isButton(button)
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.
Arguments:
button :
goog.events.BrowserEvent.MouseButton.<number>
The button to test for.
Returns:   True if button was pressed.
code »
isMouseActionButton()
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.
Returns:   The result.
code »
preventDefault()
No description.
code »
stopPropagation()
No description.
code »
disposeInternal()
No description.
code »
preventDefault()
Prevents the default action, for example a link redirecting to a url.
code »
stopPropagation()
Stops event propagation.
code »
dispose()
undefined
Disposes of the object. If the object hasn&amp;#39;t already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: 
undefined
  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass&amp;#39; disposeInternal method. Everywhere else the public dispose method must be used. For example:
mypackage.MyClass = function() {
goog.base(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
goog.base(this, &#39;disposeInternal&#39;);
// Dispose logic specific to MyClass.
...
};
code »
getDisposed()
Use #isDisposed instead. No description.
Returns:   Whether the object has been disposed of.
code »
isDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable :
that will be disposed when this object is disposed.
code »

Instance Properties

charCode :
Unicode character code.
Code »
keyCode :
Keycode of key press.
Code »
repeat :
True if this event was generated by keyboard auto-repeat (i.e., the user is holding the key down.)
Code »
altKey :
Whether alt was pressed at time of event.
Code »
button :
Which mouse button was pressed.
Code »
charCode :
Keycode of key press.
Code »
clientX :
X-coordinate relative to the window.
Code »
clientY :
Y-coordinate relative to the window.
Code »
ctrlKey :
Whether control was pressed at time of event.
Code »
currentTarget :
(Node | null | undefined)
Node that had the listener attached.
Code »
event_ :
(Event | null)
The browser event object.
Code »
keyCode :
Keycode of key press.
Code »
metaKey :
Whether the meta key was pressed at time of event.
Code »
offsetX :
X-coordinate relative to target.
Code »
offsetY :
Y-coordinate relative to target.
Code »
platformModifierKey :
Whether the default platform modifier key was pressed at time of event. (This is control for all platforms except Mac, where it's Meta.
Code »
relatedTarget :
(Node | null)
For mouseover and mouseout events, the related object for the event.
Code »
screenX :
X-coordinate relative to the monitor.
Code »
screenY :
Y-coordinate relative to the monitor.
Code »
shiftKey :
Whether shift was pressed at time of event.
Code »
state :
(Object | null)
History state object, only set for PopState events where it's a copy of the state object provided to pushState or replaceState.
Code »
target :
(Node | null)
Target that fired the event.
Code »
currentTarget :
(Object | null | undefined)
Object that had the listener attached.
Code »
propagationStopped_ :
Whether to cancel the event in internal capture/bubble processing for IE.
Code »
returnValue_ :
Return value for in internal capture/bubble processing for IE.
Code »
target :
(Object | null | undefined)
Target of the event.
Code »
type :
Event type.
Code »
dependentDisposables_ :
(Array | null)
Disposables that should be disposed when this object is disposed.
Code »
disposed_ :
Whether the object has been disposed of.
Code »

Package events

Package Reference