forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
class_bot_Keyboard.html
39 lines (39 loc) · 36.3 KB
/
class_bot_Keyboard.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html><meta charset="UTF-8"><title>bot.Keyboard</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class bot.Keyboard</h1><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l46">code »</a><pre><code><a href="class_bot_Device.html">bot.Device</a>
└ bot.Keyboard</code></pre></header><section><p>A keyboard that provides atomic typing actions.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member"><a name="bot.Keyboard">bot.Keyboard</a> <span class="args">(opt_state)</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_state: <code class="type">{pressed: !<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>, currentPos: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}=</code><dd>Optional keyboard state.</dl></table></div></div></div></section><section><h2>Classes</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a><dd>A key on the keyboard.</dl></table></div></section><section><h2>Enumerations</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="enum_bot_Keyboard_Keys.html">bot.Keyboard.Keys</a><dd>An enumeration of keys known to this module.</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">bot.Keyboard</code></h3><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l804">code »</a><span class="member"><a name="fireKeyEvent_">fireKeyEvent_</a> <span class="args">(type, key, opt_preventDefault)</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>Event type.<dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key.<dt>opt_preventDefault: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the default event should be
prevented. Defaults to false.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully or was cancelled.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l568">code »</a><span class="member"><a name="getChar_">getChar_</a> <span class="args">(key)</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Given the current state of the SHIFT and CAPS_LOCK key, returns the
character that will be typed is the specified key is pressed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key.</dl><tr><th>Returns<tr><td><dl>Character to be typed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l868">code »</a><span class="member"><a name="getModifiersState">getModifiersState</a> <span class="args">()</span> ⇒ <code class="type"><a href="class_bot_Device_ModifiersState.html">bot.Device.ModifiersState</a></code></span></div><p>Returns the state of the modifier keys, to be shared with other input
devices.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Modifiers state.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l849">code »</a><span class="member"><a name="getState">getState</a> <span class="args">()</span> ⇒ <code class="type">{pressed: !<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>, currentPos: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}</code></span></div><p>Serialize the current state of the keyboard.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The
current keyboard state.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l402">code »</a><span class="member"><a name="isPressed">isPressed</a> <span class="args">(key)</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>Returns whether the key is currently pressed.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key.</dl><tr><th>Returns<tr><td><dl>Whether the key is pressed.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l516">code »</a><span class="member"><a name="maybeEditText_">maybeEditText_</a> <span class="args">(key)</span></span></div><p>Maybe edit text when a key is pressed in an editable form.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key that was pressed.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l485">code »</a><span class="member"><a name="maybeSubmitForm_">maybeSubmitForm_</a> <span class="args">(key)</span></span></div><p>Maybe submit a form if the ENTER key is released. On non-FF browsers, firing
the keyPress and keyRelease events for the ENTER key does not result in a
form being submitted so we have to fire the form submit event as well.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l831">code »</a><span class="member"><a name="moveCursor">moveCursor</a> <span class="args">(element)</span></span></div><p>Sets focus to the element. If the element does not have focus, place cursor
at the end of the text in the element.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>element: <code class="type">!<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code><dd>Element that is moved to.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l414">code »</a><span class="member"><a name="pressKey">pressKey</a> <span class="args">(key)</span></span></div><p>Presses the given key on the keyboard. Keys that are pressed can be pressed
again before releasing, to simulate repeated keys, except for modifier keys,
which must be released before they can be pressed again.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key to press.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l547">code »</a><span class="member"><a name="releaseKey">releaseKey</a> <span class="args">(key)</span></span></div><p>Releases the given key on the keyboard. Releasing a key that is not
pressed results in an exception.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key to release.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l453">code »</a><span class="member"><a name="requiresKeyPress_">requiresKeyPress_</a> <span class="args">(key)</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 the given key currently requires a keypress.
TODO: Make this dependent on the state of the modifier keys.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key.</dl><tr><th>Returns<tr><td><dl>Whether it requires a keypress event.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l370">code »</a><span class="member"><a name="setKeyPressed_">setKeyPressed_</a> <span class="args">(key, isPressed)</span></span></div><p>Set the modifier state if the provided key is one, otherwise just add
to the list of pressed keys.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>The key to update.<dt>isPressed: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>Whether the key is pressed.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l791">code »</a><span class="member"><a name="updateCurrentPos_">updateCurrentPos_</a> <span class="args">(pos)</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>pos: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>New position of the cursor.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l638">code »</a><span class="member"><a name="updateOnBackspaceOrDelete_">updateOnBackspaceOrDelete_</a> <span class="args">(key)</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Backspace or delete key.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l591">code »</a><span class="member"><a name="updateOnCharacter_">updateOnCharacter_</a> <span class="args">(key)</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Key with character to insert.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l611">code »</a><span class="member"><a name="updateOnEnter_">updateOnEnter_</a> <span class="args">()</span></span></div></summary></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l752">code »</a><span class="member"><a name="updateOnHomeOrEnd_">updateOnHomeOrEnd_</a> <span class="args">(key)</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Special key to press.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l686">code »</a><span class="member"><a name="updateOnLeftOrRight_">updateOnLeftOrRight_</a> <span class="args">(key)</span></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code><dd>Special key to press.</dl></table></div></details></div></div><h3>Defined in <code class="type"><a href="class_bot_Device.html">bot.Device</a></code></h3><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l385">code »</a><span class="member"><a name="clickElement">clickElement</a> <span class="args">(coord, button, opt_pointerId)</span></span></div><p>A helper function to fire click events. This method is shared between
the mouse and touchscreen devices.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>coord: <code class="type">!<a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></code><dd>The coordinate where event will fire.<dt>button: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The mouse button value for the event.<dt>opt_pointerId: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The pointer id associated with the click.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l110">code »</a><span class="member"><a name="fireHtmlEvent">fireHtmlEvent</a> <span class="args">(type)</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>Fires an HTML event given the state of the device.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>HTML Event type.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully; false if cancelled.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l124">code »</a><span class="member"><a name="fireKeyboardEvent">fireKeyboardEvent</a> <span class="args">(type, 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>Fires a keyboard event given the state of the device and the given arguments.
TODO: Populate the modifier keys in this method.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>Keyboard event type.<dt>args: <code class="type"><a href="namespace_bot_events.html#bot.events.KeyboardArgs">bot.events.KeyboardArgs</a></code><dd>Keyboard event arguments.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully; false if cancelled.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l261">code »</a><span class="member"><a name="fireMSPointerEvent">fireMSPointerEvent</a> <span class="args">(type, coord, button, pointerId, device, isPrimary, opt_related, opt_force)</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>Fires a MSPointer event given the state of the device and the given
arguments.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>MSPointer event type.<dt>coord: <code class="type">!<a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></code><dd>The coordinate where event will fire.<dt>button: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The mouse button value for the event.<dt>pointerId: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The pointer id for this event.<dt>device: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The device type used for this event.<dt>isPrimary: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>Whether the pointer represents the primary point
of contact.<dt>opt_related: <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a>=</code><dd>The related element of this event.<dt>opt_force: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the event should be fired even if the
element is not interactable, such as the case of a mousemove or
mouseover event that immediately follows a mouseout.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully; false if cancelled.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l145">code »</a><span class="member"><a name="fireMouseEvent">fireMouseEvent</a> <span class="args">(type, coord, button, opt_related, opt_wheelDelta, opt_force, opt_pointerId)</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>Fires a mouse event given the state of the device and the given arguments.
TODO: Populate the modifier keys in this method.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>Mouse event type.<dt>coord: <code class="type">!<a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></code><dd>The coordinate where event will fire.<dt>button: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The mouse button value for the event.<dt>opt_related: <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a>=</code><dd>The related element of this event.<dt>opt_wheelDelta: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The wheel delta value for the event.<dt>opt_force: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether the event should be fired even if the
element is not interactable, such as the case of a mousemove or
mouseover event that immediately follows a mouseout.<dt>opt_pointerId: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The pointerId associated with the event.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully; false if cancelled.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l198">code »</a><span class="member"><a name="fireTouchEvent">fireTouchEvent</a> <span class="args">(type, id, coord, opt_id2, opt_coord2)</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>Fires a touch event given the state of the deive and the given arguments.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>Event type.<dt>id: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The touch identifier.<dt>coord: <code class="type">!<a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></code><dd>The coordinate where event will fire.<dt>opt_id2: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The touch identifier of the second finger.<dt>opt_coord2: <code class="type">!<a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a>=</code><dd>The coordinate of the second
finger, if any.</dl><tr><th>Returns<tr><td><dl>Whether the event fired successfully or was cancelled.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l454">code »</a><span class="member"><a name="focusOnElement">focusOnElement</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>Focuses on the given element and returns true if it supports being focused
and does not already have focus; otherwise, returns false. If another element
has focus, that element will be blurred before focusing on the given element.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the element was given focus.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l79">code »</a><span class="member"><a name="getElement">getElement</a> <span class="args">()</span> ⇒ <code class="type">!<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code></span></div><p>Returns the element with which the device is interacting.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Element being interacted with.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l332">code »</a><span class="member"><a name="getTargetOfOptionMouseEvent_">getTargetOfOptionMouseEvent_</a> <span class="args">(type)</span> ⇒ <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code></span></div><p>A mouse event fired "on" an option element, doesn't always fire on the
option element itself. Sometimes it fires on the parent select element
and sometimes not at all, depending on the browser and event type. This
returns the true target element of the event, or null if none is fired.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>type: <code class="type"><a href="enum_bot_events_EventType.html">bot.events.EventType</a></code><dd>Type of event.</dl><tr><th>Returns<tr><td><dl>Element the event should be fired on, null if none.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l615">code »</a><span class="member"><a name="maybeToggleOption">maybeToggleOption</a> <span class="args">()</span></span></div><p>Toggles the selected state of the current element if it is an option. This
is a noop if the element is not an option, or if it is selected and belongs
to a single-select, because it can't be toggled off.</summary></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l90">code »</a><span class="member"><a name="setElement">setElement</a> <span class="args">(element)</span></span></div><p>Sets the element with which the device is interacting.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>element: <code class="type">!<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code><dd>Element being interacted with.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l693">code »</a><span class="member"><a name="submitForm">submitForm</a> <span class="args">(form)</span></span></div><p>Submits the specified form. Unlike the public function, it expects to be
given a form element and fails if it is not.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>form: <code class="type">!<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code><dd>The form to submit.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l648">code »</a><span class="member"><a name="toggleRadioButtonOrCheckbox_">toggleRadioButtonOrCheckbox_</a> <span class="args">(wasChecked)</span></span></div><p>Toggles the checked state of a radio button or checkbox. This is a noop if
it is a radio button that is checked, because it can't be toggled off.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>wasChecked: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>Whether the element was originally checked.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><h3>Defined in <code class="type">bot.Keyboard</code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l53">code »</a><span class="member"><a name="currentPos_">currentPos_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l50">code »</a><span class="member"><a name="editable_">editable_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l56">code »</a><span class="member"><a name="pressed_">pressed_</a> : <code class="type">!<a href="class_goog_structs_Set.html">goog.structs.Set</a></code></span></div></summary></details></div></div><h3>Defined in <code class="type"><a href="class_bot_Device.html">bot.Device</a></code></h3><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l48">code »</a><span class="member"><a name="element_">element_</a> : <code class="type">!<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code></span></div><p>Element being interacted with.</summary></details></div></div><div class="wrap-details protected"><div><details><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l69">code »</a><span class="member"><a name="eventEmitter">eventEmitter</a> : <code class="type">!<a href="class_bot_Device_EventEmitter.html">bot.Device.EventEmitter</a></code></span></div></summary></details></div></div><div class="wrap-details protected"><div><details><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l66">code »</a><span class="member"><a name="modifiersState">modifiersState</a> : <code class="type"><a href="class_bot_Device_ModifiersState.html">bot.Device.ModifiersState</a></code></span></div><p>State of modifier keys for this device.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_device.js.src.html#l54">code »</a><span class="member"><a name="select_">select_</a> : <code class="type"><a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614">Element</a></code></span></div><p>If the element is an option, this is its parent select element.</summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l93">code »</a><span class="member"><a name="bot.Keyboard.newKey_">bot.Keyboard.newKey_</a> <span class="args">(code, opt_char, opt_shiftChar)</span> ⇒ <code class="type">!<a href="class_bot_Keyboard_Key.html">bot.Keyboard.Key</a></code></span></div><p>Constructs a new key and, if it is a character key, adds a mapping from the
character to is in the CHAR_TO_KEY_ map. Using this factory function instead
of the new keyword, also helps reduce the size of the compiled Js fragment.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>code: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Null">null</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>|{gecko: (?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>), ieWebkit: (?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>), opera: (?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)})</code><dd>Either a single keycode or a record of per-browser keycodes.<dt>opt_char: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>Character when shift is not pressed.<dt>opt_shiftChar: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>Character when shift is pressed.</dl><tr><th>Returns<tr><td><dl>The new key.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l77">code »</a><span class="member"><a name="bot.Keyboard.CHAR_TO_KEY_">bot.Keyboard.CHAR_TO_KEY_</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Maps characters to (key,boolean) pairs, where the key generates the
character and the boolean is true when the shift must be pressed.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l583">code »</a><span class="member"><a name="bot.Keyboard.KEYPRESS_EDITS_TEXT_">bot.Keyboard.KEYPRESS_EDITS_TEXT_</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 firing a keypress event causes text to be edited without any
additional logic to surgically apply the edit.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l353">code »</a><span class="member"><a name="bot.Keyboard.KEY_TO_MODIFIER_">bot.Keyboard.KEY_TO_MODIFIER_</a> : <code class="type">!<a href="class_goog_structs_Map.html">goog.structs.Map</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code></span></div><p>The reverse map - key to modifier.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l322">code »</a><span class="member"><a name="bot.Keyboard.MODIFIERS">bot.Keyboard.MODIFIERS</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Array of modifier keys.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l334">code »</a><span class="member"><a name="bot.Keyboard.MODIFIER_TO_KEY_MAP_">bot.Keyboard.MODIFIER_TO_KEY_MAP_</a> : <code class="type">!<a href="class_goog_structs_Map.html">goog.structs.Map</a></code></span></div><p>Map of modifier to key.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source_javascript_atoms_keyboard.js.src.html#l392">code »</a><span class="member"><a name="bot.Keyboard.NEW_LINE_">bot.Keyboard.NEW_LINE_</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>The value used for newlines in the current browser/OS combination. Although
the line endings look platform dependent, they are browser dependent. In
particular, Opera uses \r\n on all platforms.</summary></details></div></div><div class="wrap-details public"><div><details><summary><div><span class="member"><a name="bot.Keyboard.superClass_">bot.Keyboard.superClass_</a> : <code class="type"><a href="class_bot_Device.html">bot.Device.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" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div></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>