events.BrowserEvent Extends goog.events.Event
Accepts a browser event object and creates a patched, cross browser event object. The content of this object will not be initialized if no event object is provided. If this is the case, init() needs to be invoked separately.

Inheritance

Object
     goog.Disposable
          goog.events.Event
               goog.events.BrowserEvent

Constructor

goog.events.BrowserEvent(opt_eopt_currentTarget)

Parameters

opt_e :
Event
Browser event object.
opt_currentTarget :
Current target for event.

Instance Methods

Public Protected Private
disposeInternal()
No description.
code »
getBrowserEvent()
Event
No description.
Returns: 
Event
  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
Browser event object.
opt_currentTarget :
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
The button to test for.
Returns:   True if button was pressed.
code »
preventDefault()
No description.
code »
stopPropagation()
No description.
code »
disposeInternal()
No description.
code »
preventDefault()
No description.
code »
stopPropagation()
No description.
code »
dispose()
No description.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. For example:
mypackage.MyClass = function() {
goog.Disposable.call(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
mypackage.MyClass.superClass_.disposeInternal.call(this);
// Dispose logic specific to MyClass.
...
};
code »
getDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »
isDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »

Instance Properties

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 »
event_ :
Event
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 »
relatedTarget :
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 »
target :
Target that fired the event.
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 »
disposed_ :
Whether the object has been disposed of.
Code »

Static Properties

goog.events.BrowserEvent.IE7_SET_KEY_CODE_TO_PREVENT_DEFAULT_ :
To prevent default in IE7 for certain keydown events we need set the keyCode to -1.
Code »
goog.events.BrowserEvent.IEButtonMap_ :
Static data for mapping mouse buttons.
Code »

Package events

Package Reference