devtools-docs/docs/protocol/tot/input.html

659 строки
9.4 KiB
HTML

{{+bindTo:partials.standard_devtools_article}}
<h1>tot: Input</h1>
<div>
<!-- TABLE OF CONTENTS -->
<div id="toc">
<div class="collapsible">
<h2>Contents</h2>
<ol>
<li>
<a href='#commands'">Commands</a>
<ol>
<li>
<a href="#command-dispatchKeyEvent" href="#command-anchor">dispatchKeyEvent</a>
</li>
<li>
<a href="#command-dispatchMouseEvent" href="#command-anchor">dispatchMouseEvent</a>
</li>
</ol>
</li>
</ol>
</div><!-- /TABLE OF CONTENTS -->
<!-- API PAGE -->
<div>
<!-- COMMANDS -->
<div class="protocol-group">
<a name="commands"></a>
<h3>Commands</h3>
<div class="protocol-item">
<a name="command-dispatchKeyEvent"></a>
<h4>Input.dispatchKeyEvent</h4>
<div class="summary">
<!-- REQUEST -->
request: {<br>
"id": &lt;number&gt;,<br>
"method": "Input.dispatchKeyEvent",<br>
"params": {<br>
&nbsp;&nbsp;"<span class="specific">type</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">modifiers</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">timestamp</span>": &lt;number&gt;,<br>
&nbsp;&nbsp;"<span class="specific">text</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">unmodifiedText</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">keyIdentifier</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">windowsVirtualKeyCode</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">nativeVirtualKeyCode</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">macCharCode</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">autoRepeat</span>": &lt;boolean&gt;,<br>
&nbsp;&nbsp;"<span class="specific">isKeypad</span>": &lt;boolean&gt;,<br>
&nbsp;&nbsp;"<span class="specific">isSystemKey</span>": &lt;boolean&gt;<br>
}
<div>}</div>
<!-- RESPONSE -->
response: {<br>
"id": &lt;number&gt;,<br>
"error": &lt;object&gt;
<div>}</div>
</div>
<div class="description">
<p>Dispatches a key event to the page.</p>
<!-- PARAMETERS -->
<h4>Parameters</h4>
<div class="parameters">
<div><span class="value">
<strong>
<var>
type
<!-- TYPE -->
<div style="display:inline">
(
<span>enumerated</span>
string
[
"char"
,
"keyDown"
,
"keyUp"
,
"rawKeyDown"
]
)
</div>
</var>
</strong>
<div class="description">
Type of the key event.
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
modifiers
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
timestamp
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
number
)
</div>
</var>
</strong>
<div class="description">
Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
text
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
string
)
</div>
</var>
</strong>
<div class="description">
Text as generated by processing a virtual key code with a keyboard layout. Not needed for for <code>keyUp</code> and <code>rawKeyDown</code> events (default: "")
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
unmodifiedText
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
string
)
</div>
</var>
</strong>
<div class="description">
Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
keyIdentifier
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
string
)
</div>
</var>
</strong>
<div class="description">
Unique key identifier (e.g., 'U+0041') (default: "").
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
windowsVirtualKeyCode
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Windows virtual key code (default: 0).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
nativeVirtualKeyCode
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Native virtual key code (default: 0).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
macCharCode
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Mac character code (default: 0).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
autoRepeat
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
boolean
)
</div>
</var>
</strong>
<div class="description">
Whether the event was generated from auto repeat (default: false).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
isKeypad
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
boolean
)
</div>
</var>
</strong>
<div class="description">
Whether the event was generated from the keypad (default: false).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
isSystemKey
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
boolean
)
</div>
</var>
</strong>
<div class="description">
Whether the event was a system key event (default: false).
</div>
</span>
</div>
</div>
</div>
</div>
<div class="protocol-item">
<a name="command-dispatchMouseEvent"></a>
<h4>Input.dispatchMouseEvent</h4>
<div class="summary">
<!-- REQUEST -->
request: {<br>
"id": &lt;number&gt;,<br>
"method": "Input.dispatchMouseEvent",<br>
"params": {<br>
&nbsp;&nbsp;"<span class="specific">type</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">x</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">y</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">modifiers</span>": &lt;integer&gt;,<br>
&nbsp;&nbsp;"<span class="specific">timestamp</span>": &lt;number&gt;,<br>
&nbsp;&nbsp;"<span class="specific">button</span>": &lt;string&gt;,<br>
&nbsp;&nbsp;"<span class="specific">clickCount</span>": &lt;integer&gt;<br>
}
<div>}</div>
<!-- RESPONSE -->
response: {<br>
"id": &lt;number&gt;,<br>
"error": &lt;object&gt;
<div>}</div>
</div>
<div class="description">
<p>Dispatches a mouse event to the page.</p>
<!-- PARAMETERS -->
<h4>Parameters</h4>
<div class="parameters">
<div><span class="value">
<strong>
<var>
type
<!-- TYPE -->
<div style="display:inline">
(
<span>enumerated</span>
string
[
"mouseMoved"
,
"mousePressed"
,
"mouseReleased"
]
)
</div>
</var>
</strong>
<div class="description">
Type of the mouse event.
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
x
<!-- TYPE -->
<div style="display:inline">
(
integer
)
</div>
</var>
</strong>
<div class="description">
X coordinate of the event relative to the main frame's viewport.
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
y
<!-- TYPE -->
<div style="display:inline">
(
integer
)
</div>
</var>
</strong>
<div class="description">
Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
modifiers
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
timestamp
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
number
)
</div>
</var>
</strong>
<div class="description">
Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
button
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
<span>enumerated</span>
string
[
"left"
,
"middle"
,
"none"
,
"right"
]
)
</div>
</var>
</strong>
<div class="description">
Mouse button (default: "none").
</div>
</span>
</div>
<div><span class="value">
<strong>
<var>
clickCount
<!-- TYPE -->
<div style="display:inline">
(
<span class="optional">optional</span>
integer
)
</div>
</var>
</strong>
<div class="description">
Number of times the mouse button was clicked (default: 0).
</div>
</span>
</div>
</div>
</div>
</div>
<!-- for commands -->
</div>
<!-- if commands -->
<!-- EVENTS -->
<!-- if events -->
<!-- TYPES -->
<!-- if types -->
</div><!-- API PAGE -->
</div>
</div>
{{/partials.standard_devtools_article}}