selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
25 lines (22 loc) • 19.3 kB
HTML
<meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.events.BrowserEvent</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.events.BrowserEvent</h1><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l66">code »</a><pre><code><a href="class_goog_events_Event.html">goog.events.Event</a>
└ goog.events.BrowserEvent</code></pre></header><section><p>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.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.events.BrowserEvent <span class="args">( opt_e, opt_currentTarget )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_e: <code class="type">Event=</code><dd>Browser event object.<dt>opt_currentTarget: <code class="type">EventTarget=</code><dd>Current target for event.</dl></table></div></div></div></section><section><h2>Enumerations</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="enum_goog_events_BrowserEvent_MouseButton.html">goog.events.BrowserEvent.MouseButton</a><dd>Normalized button constants for the mouse.</dl></table></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><h3>Defined in <code class="type">goog.events.BrowserEvent</code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l389">code »</a><span class="member"><a name="disposeInternal">disposeInternal</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l383">code »</a><span class="member"><a name="getBrowserEvent">getBrowserEvent</a> <span class="args">( )</span> ⇒ <code class="type">Event</code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The underlying browser event object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l222">code »</a><span class="member"><a name="init">init</a> <span class="args">( e, opt_currentTarget )</span></span></div><p>Accepts a browser event object and creates a patched, cross browser event
object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>e: <code class="type">Event</code><dd>Browser event object.<dt>opt_currentTarget: <code class="type">EventTarget=</code><dd>Current target for event.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l297">code »</a><span class="member"><a name="isButton">isButton</a> <span class="args">( button )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>button: <code class="type"><a href="enum_goog_events_BrowserEvent_MouseButton.html">goog.events.BrowserEvent.MouseButton</a></code><dd>The button
to test for.</dl><tr><th>Returns<tr><td><dl>True if button was pressed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l319">code »</a><span class="member"><a name="isMouseActionButton">isMouseActionButton</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>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.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The result.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l343">code »</a><span class="member"><a name="preventDefault">preventDefault</a> <span class="args">( )</span></span></div></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l330">code »</a><span class="member"><a name="stopPropagation">stopPropagation</a> <span class="args">( )</span></span></div></summary></details></div></div><h3>Defined in <code class="type"><a href="class_goog_events_Event.html">goog.events.Event</a></code></h3><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/events/event.js.src.html#l121">code »</a><span class="member deprecation-notice"><a name="dispose">dispose</a> <span class="args">( )</span></span></div><div class="deprecation-notice">Deprecated: <span class="deprecation-reason">Events don't need to be disposed.</span></div><p>For backwards compatibility (goog.events.Event used to inherit
goog.Disposable).</summary></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">goog.events.BrowserEvent</code></h3><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l153">code »</a><span class="member"><a name="altKey">altKey</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether alt was pressed at time of event.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l129">code »</a><span class="member"><a name="button">button</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Which mouse button was pressed.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l141">code »</a><span class="member"><a name="charCode">charCode</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Keycode of key press.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l105">code »</a><span class="member"><a name="clientX">clientX</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>X-coordinate relative to the window.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l111">code »</a><span class="member"><a name="clientY">clientY</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Y-coordinate relative to the window.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l147">code »</a><span class="member"><a name="ctrlKey">ctrlKey</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether control was pressed at time of event.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l81">code »</a><span class="member"><a name="currentTarget">currentTarget</a> : <code class="type">(<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247">Node</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code></span></div><p>Node that had the listener attached.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l185">code »</a><span class="member"><a name="event_">event_</a> : <code class="type">Event</code></span></div><p>The browser event object.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l135">code »</a><span class="member"><a name="keyCode">keyCode</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Keycode of key press.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l165">code »</a><span class="member"><a name="metaKey">metaKey</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the meta key was pressed at time of event.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l93">code »</a><span class="member"><a name="offsetX">offsetX</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>X-coordinate relative to target.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l99">code »</a><span class="member"><a name="offsetY">offsetY</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Y-coordinate relative to target.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l179">code »</a><span class="member"><a name="platformModifierKey">platformModifierKey</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the default platform modifier key was pressed at time of event.
(This is control for all platforms except Mac, where it's Meta.)</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l87">code »</a><span class="member"><a name="relatedTarget">relatedTarget</a> : <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247">Node</a></code></span></div><p>For mouseover and mouseout events, the related object for the event.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l117">code »</a><span class="member"><a name="screenX">screenX</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>X-coordinate relative to the monitor.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l123">code »</a><span class="member"><a name="screenY">screenY</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Y-coordinate relative to the monitor.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l159">code »</a><span class="member"><a name="shiftKey">shiftKey</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether shift was pressed at time of event.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l172">code »</a><span class="member"><a name="state">state</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>History state object, only set for PopState events where it's a copy of the
state object provided to pushState or replaceState.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l74">code »</a><span class="member"><a name="target">target</a> : <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247">Node</a></code></span></div><p>Target that fired the event.</summary></details></div></div><h3>Defined in <code class="type"><a href="class_goog_events_Event.html">goog.events.Event</a></code></h3><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/event.js.src.html#l94">code »</a><span class="member"><a name="defaultPrevented">defaultPrevented</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the default action has been prevented.
This is a property to match the W3C specification at
<code class="type"><a class="unresolved-link">#events-event-type-defaultPrevented</a></code>.
Must be treated as read-only outside the class.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/event.js.src.html#l84">code »</a><span class="member"><a name="propagationStopped_">propagationStopped_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether to cancel the event in internal capture/bubble processing for IE.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/event.js.src.html#l103">code »</a><span class="member"><a name="returnValue_">returnValue_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Return value for in internal capture/bubble processing for IE.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/event.js.src.html#l60">code »</a><span class="member"><a name="type">type</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Event type.</summary></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l209">code »</a><span class="member"><a name="goog.events.BrowserEvent.IEButtonMap">goog.events.BrowserEvent.IEButtonMap</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code></span></div><p>Static data for mapping mouse buttons.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/events/browserevent.js.src.html#l66">code »</a><span class="member"><a name="goog.events.BrowserEvent.superClass_">goog.events.BrowserEvent.superClass_</a> : <code class="type"><a href="class_goog_events_Event.html">goog.events.Event.prototype</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>