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

Constructor

goog.events.BrowserEvent(opt_eopt_currentTarget)

Parameters

opt_e : Event=
Browser event object.
opt_currentTarget : EventTarget=
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 : EventTarget=
Current target for event.
code »
isButton(button) 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.
Arguments:
button : goog.events.BrowserEvent.MouseButton
The button to test for.
Returns: boolean  True if button was pressed.
code »
isMouseActionButton() 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.
Returns: boolean  The result.
code »
preventDefault()
No description.
code »
stopPropagation()
No description.
code »
dispose()
Events don't need to be disposed. For backwards compatibility (goog.events.Event used to inherit goog.Disposable).
code »
disposeInternal()
Events don't need to be disposed. For backwards compatibility (goog.events.Event used to inherit goog.Disposable).
code »
preventDefault()
Prevents the default action, for example a link redirecting to a url.
code »
stopPropagation()
Stops event propagation.
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 »
constructor :
No description.
Code »
ctrlKey :
Whether control was pressed at time of event.
Code »
currentTarget :
Node that had the listener attached.
Code »
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 »
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 :
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 :
History state object, only set for PopState events where it's a copy of the state object provided to pushState or replaceState.
Code »
target :
Target that fired the event.
Code »
currentTarget :
Object that had the listener attached.
Code »
defaultPrevented :
Whether the default action has been prevented. This is a property to match the W3C specification at http://www.w3.org/TR/DOM-Level-3-Events/ #events-event-type-defaultPrevented. Must be treated as read-only outside the class.
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 :
Target of the event.
Code »
type :
Event type.
Code »

Static Properties

goog.events.BrowserEvent.IEButtonMap :
Static data for mapping mouse buttons.
Code »
goog.events.BrowserEvent.superClass_ :
No description.
Code »

Enumerations

goog.events.BrowserEvent.MouseButton :
Normalized button constants for the mouse.
Constants:
LEFT
No description.
MIDDLE
No description.
RIGHT
No description.
Code »

Package events

Package Reference