blob: 81d3ee9658bf4de1814733568293fb9c73c2cfa2 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.ui.pointer
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## MouseSource {#MouseSource}
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=25)*
<p>A method for a client to receive mouse pointer events.</p>
<p>The position of a pointer event is defined in the context of a viewport,
situated in the view. The dimensions of the view and viewport, and their
spatial relationship (defined with a transform matrix), are supplied
synchronously in a |ViewParameter| table. A view may retrieve a pointer's
position in its local coordinate system by applying the viewport-to-view
transform matrix.</p>
<p>The viewport is embedded in an independent and stable coordinate system,
suitable for interpreting pointer events in a scale-independent manner;
mouse movement will be observed at a constant scale, even under effects such
as magnification or panning. However, other effects, such as enlargening the
view's clip bounds, may trigger a change in the viewport extents.</p>
### Watch {#MouseSource.Watch}
<p>A method for a client to receive mouse pointer events.</p>
<p>This call is formulated as a &quot;hanging get&quot; pattern: the client asks for
a set of recent events, and receives them via the callback. This
pull-based approach ensures that clients consume events at their own
pace; events don't clog up the channel in an unbounded manner.</p>
<p>Flow control. The caller is allowed at most one in-flight |Watch| call
at a time; it is a logical error to have concurrent calls to |Watch|.
Non-compliance results in channel closure.</p>
<p>Client pacing. The server will dispatch events to the caller on a FIFO,
lossless, best-effort basis, but the caller must allocate enough time to
keep up with new events.</p>
<p>Event times. The timestamps on each event in the event vector are <em>not</em>
guaranteed monotonic; events from different devices may be injected into
Scenic at different times. Generally, events from a single device are
expected to have monotonically increasing timestamps.</p>
<p>View parameters. Occasionally, changes in view or viewport require
notifying the client. If a |MouseEvent| carries |ViewParameters|, these
parameters apply to successive |MousePointerSample|s until the next
|ViewParameters|.</p>
#### Request {#MouseSource.Watch_Request}
&lt;EMPTY&gt;
#### Response {#MouseSource.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>events</code></td>
<td>
<code>vector&lt;<a class='link' href='#MouseEvent'>MouseEvent</a>&gt;[128]</code>
</td>
</tr>
</table>
## TouchSource {#TouchSource}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=25)*
<p>A method for a client to receive touch events and respond in a global
gesture disambiguation protocol.</p>
<p>The position of a touch event is defined in the context of a viewport,
situated in the view. The dimensions of the view and viewport, and their
spatial relationship (defined with a transform matrix), are supplied
synchronously in a |ViewParameter| table. A view may retrieve a pointer's
position in its local coordinate system by applying the viewport-to-view
transform matrix.</p>
<p>The viewport is embedded in an independent and stable coordinate system,
suitable for interpreting touch events in a scale-independent manner; a
swipe will be observed at a constant scale, even under effects such as
magnification or panning. However, other effects, such as enlargening the
view's clip bounds, may trigger a change in the viewport extents.</p>
### UpdateResponse {#TouchSource.UpdateResponse}
<p>The gesture protocol allows a client to enact a &quot;hold&quot; on an open
interaction of touch events; it prevents resolution of interaction
ownership, even after the interaction closes. This method updates the
client's previous &quot;hold&quot; by replacing it with a response that allows
ownership resolution to proceed.</p>
<p>See |TouchInteractionId| for how a stream is structured into
interactions.</p>
<p>Flow control. The caller is allowed at most one |UpdateResponse| call
per interaction, and it must be on a closed interaction. It is a logical
error to call |UpdateResponse| when a normal response is possible with
the |Watch| call.</p>
<p>Validity. This TouchResponse must not be another &quot;hold&quot; response, and
the overwritten response is expected to be a &quot;hold&quot; response.</p>
#### Request {#TouchSource.UpdateResponse_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>interaction</code></td>
<td>
<code><a class='link' href='#TouchInteractionId'>TouchInteractionId</a></code>
</td>
</tr>
<tr>
<td><code>response</code></td>
<td>
<code><a class='link' href='#TouchResponse'>TouchResponse</a></code>
</td>
</tr>
</table>
#### Response {#TouchSource.UpdateResponse_Response}
&lt;EMPTY&gt;
### Watch {#TouchSource.Watch}
<p>A method for a client to receive touch pointer events.</p>
<p>This call is formulated as a &quot;hanging get&quot; pattern: the client asks for
a set of recent events, and receives them via the callback. This
pull-based approach ensures that clients consume events at their own
pace; events don't clog up the channel in an unbounded manner.</p>
<p>Flow control. The caller is allowed at most one in-flight |Watch| call
at a time; it is a logical error to have concurrent calls to |Watch|.
Non-compliance results in channel closure.</p>
<p>Client pacing. The server will dispatch events to the caller on a FIFO,
lossless, best-effort basis, but the caller must allocate enough time to
keep up with new events. An unresponsive client may be categorized as
&quot;App Not Responding&quot; and targeted for channel closure.</p>
<p>Responses. The gesture disambiguation scheme relies on the server
receiving a |TouchResponse| for each |TouchEvent|.|TouchPointerSample|;
non-sample events should return an empty |TouchResponse| table to the
server. Responses for <em>previous</em> events are fed to the server on the
<em>next</em> call of |Watch| [1]. Each element in the |responses| vector is
interpreted as the pairwise response to the event in the previous
|events| vector; the vector lengths must match. Note that the client's
contract to respond to events starts as soon as it registers its
endpoint with scenic, NOT when it first calls <code>Watch()</code>.</p>
<p>Initial response. The first call to |Watch| must be an empty vector.</p>
<p>Event times. The timestamps on each event in the event vector are <em>not</em>
guaranteed monotonic; touch events from different devices may be
injected into Scenic at different times. Generally, events from a single
device are expected to have monotonically increasing timestamps.</p>
<p>View parameters. Occasionally, changes in view or viewport require
notifying the client. If a |TouchEvent| carries |ViewParameters|, these
parameters apply to successive |TouchPointerSample|s until the next
|ViewParameters|.</p>
<p>[1] The hanging get pattern enables straightforward API evolution, but
unfortunately does not admit an idiomatic matching of response to event.</p>
#### Request {#TouchSource.Watch_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>responses</code></td>
<td>
<code>vector&lt;<a class='link' href='#TouchResponse'>TouchResponse</a>&gt;[128]</code>
</td>
</tr>
</table>
#### Response {#TouchSource.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>events</code></td>
<td>
<code>vector&lt;<a class='link' href='#TouchEvent'>TouchEvent</a>&gt;[128]</code>
</td>
</tr>
</table>
## **STRUCTS**
### MouseEventStreamInfo {#MouseEventStreamInfo data-text="MouseEventStreamInfo"}
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=168)*
<p>The status of a mouse event stream, sent from server to client.</p>
<p>Invariant: a client's mouse events are bracketed by
<a class='link' href='#MouseViewStatus.ENTERED'>MouseViewStatus.ENTERED</a> and <a class='link' href='#MouseViewStatus.EXITED'>MouseViewStatus.EXITED</a>.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="MouseEventStreamInfo.device_id">
<td><code>device_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier for the mouse device that issues a mouse event stream.</p>
</td>
<td>No default</td>
</tr>
<tr id="MouseEventStreamInfo.status">
<td><code>status</code></td>
<td>
<code><a class='link' href='#MouseViewStatus'>MouseViewStatus</a></code>
</td>
<td><p>The mouse event stream's enter/exit status, sent from server to client.</p>
</td>
<td>No default</td>
</tr>
</table>
### Rectangle {#Rectangle data-text="Rectangle"}
*Defined in [fuchsia.ui.pointer/view.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/view.fidl;l=16)*
<p>An axis-aligned rectangle. It is defined by its minimal and maximal extents
in a coordinate system.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Rectangle.min">
<td><code>min</code></td>
<td>
<code><a class='link' href='#Point2'>Point2</a></code>
</td>
<td><p>The minimal extent of this rectangle, inclusive.</p>
<ul>
<li>Its coordinates are pairwise less than the maximal extent's
coordinates.</li>
</ul>
</td>
<td>No default</td>
</tr>
<tr id="Rectangle.max">
<td><code>max</code></td>
<td>
<code><a class='link' href='#Point2'>Point2</a></code>
</td>
<td><p>The maximal extent of this rectangle, inclusive.</p>
<ul>
<li>Its coordinates are pairwise greater than the minimal extent's
coordinates.</li>
</ul>
</td>
<td>No default</td>
</tr>
</table>
### TouchInteractionId {#TouchInteractionId data-text="TouchInteractionId"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=155)*
<p>A unique identifier for a &quot;interaction&quot; of touch events in an event stream.
Touch events are observed as a succession of interactions, as fingers engage
and disengage with the display.</p>
<p>A finite sequence of pointer events that follows the <code>EventPhase</code> state
machine, starting from the initial state ADD, is called an <strong>interaction</strong>.
A closed (or past) interaction is one where it has reached the terminal
state (REMOVE or CANCEL); an open (or current) interaction is one where it
has not.</p>
<p>For a given device pointer, a stream of events is observed as a succession
of zero or more closed interactions (the past history of user engagement),
followed by at most one open interaction (the current user engagement).</p>
<p>Because we need to group pointer events by their interaction, touch event
carries an <strong>interaction id</strong> that is unique in that pointer stream. This
common reference makes it possible to operate on a closed interaction, as
well as an open interaction.</p>
<p>Also see <code>EventPhase</code> for a discussion on event streams by mice.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="TouchInteractionId.device_id">
<td><code>device_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier for the pointer device that issues touch event streams.
A device may own multiple pointers, each with its own |pointer_id|.</p>
</td>
<td>No default</td>
</tr>
<tr id="TouchInteractionId.pointer_id">
<td><code>pointer_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier of the pointer that issued this event. It is unique only
to a specific |device_id|. Each (device_id, pointer_id) pair issues at
most one open interaction at a time.</p>
</td>
<td>No default</td>
</tr>
<tr id="TouchInteractionId.interaction_id">
<td><code>interaction_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier of the interaction. It is unique only to a specific
(device_id, pointer_id) pair.</p>
</td>
<td>No default</td>
</tr>
</table>
### TouchInteractionResult {#TouchInteractionResult data-text="TouchInteractionResult"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=185)*
<p>The result of gesture disambiguation for a interaction of touch events, sent
from server to client.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="TouchInteractionResult.interaction">
<td><code>interaction</code></td>
<td>
<code><a class='link' href='#TouchInteractionId'>TouchInteractionId</a></code>
</td>
<td><p>The interaction that this pointer sample belongs to.</p>
</td>
<td>No default</td>
</tr>
<tr id="TouchInteractionResult.status">
<td><code>status</code></td>
<td>
<code><a class='link' href='#TouchInteractionStatus'>TouchInteractionStatus</a></code>
</td>
<td><p>The interaction's disposition, sent from server to client.</p>
</td>
<td>No default</td>
</tr>
</table>
### ViewParameters {#ViewParameters data-text="ViewParameters"}
*Defined in [fuchsia.ui.pointer/view.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/view.fidl;l=40)*
<p>The parameters of the associated view and viewport, sufficient to correctly
interpret the position and scale of pointer events dispatched to this view.</p>
<p>Ordering. These parameters arrive over the same channel as pointer events,
to provide synchronous context for interpreting the position of pointer
events in the view's local coordinate system.</p>
<p>Inter-protocol redundancy. Some of these parameters may also be sent over an
independent channel dedicated to view control; the client is responsible for
correct use of asynchronously received parameters.</p>
<p>TODO(fxbug.dev/81798): Rename viewport, it is used in Flatland.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="ViewParameters.view">
<td><code>view</code></td>
<td>
<code><a class='link' href='#Rectangle'>Rectangle</a></code>
</td>
<td><p>The view's area of content, placed in the coordinate system of the view.</p>
<p>The rectangle is defined by the parent view's setup of clipping on this
view.</p>
</td>
<td>No default</td>
</tr>
<tr id="ViewParameters.viewport">
<td><code>viewport</code></td>
<td>
<code><a class='link' href='#Rectangle'>Rectangle</a></code>
</td>
<td><p>The viewport's area of interaction, placed in an independent coordinate
system.</p>
<p>A pointer event's position is defined in the coordinate system of this
viewport.</p>
<p>A change in viewport extents means the region for pointer interaction
has itself moved, or changed in size, or both.</p>
</td>
<td>No default</td>
</tr>
<tr id="ViewParameters.viewport_to_view_transform">
<td><code>viewport_to_view_transform</code></td>
<td>
<code><a class='link' href='#Mat3'>Mat3</a></code>
</td>
<td><p>The transform matrix that relates a point's position in the viewport's
coordinate system to its position in the view's coordinate system.</p>
</td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### EventPhase [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#EventPhase data-text="EventPhase"}
Type: <code>uint32</code>
*Defined in [fuchsia.ui.pointer/state.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/state.fidl;l=32)*
<p>The possible states of a pointer event. These phases of events in a stream
follow a state machine that starts with the <code>ADD</code> phase, followed by zero or
more <code>CHANGE</code> phases, and finally terminates with <code>REMOVE</code> or <code>CANCEL</code>
phase.</p>
<pre><code>ADD ---&gt; CHANGE* -+-&gt; REMOVE
|
+-&gt; CANCEL
</code></pre>
<p>A finite sequence of pointer events that follows this state machine,
starting from the initial state, is called an <strong>interaction</strong>. A closed (or
past) interaction is one where it has reached the terminal state; an open
(or current) interaction is one where it has not.</p>
<p>For a given device pointer, a stream of events is observed as a succession
of zero or more closed interactions (the past history of user engagement),
followed by at most one open interaction (the current user engagement).</p>
<p>When we need to group pointer events by their interaction, an event carries
an <strong>interaction id</strong> that is unique in that pointer stream. This common
reference makes it possible to operate on a closed interaction, as well as
an open interaction.</p>
<p>For example, touch events are typically observed as a succession of
interactions, as fingers engage and disengage with the display.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="EventPhase.ADD">
<td><h3 id="EventPhase.ADD" class="add-link hide-from-toc">ADD</h3></td>
<td><code>1</code></td>
<td><p>The device has started tracking the pointer.</p>
</td>
</tr>
<tr id="EventPhase.CHANGE">
<td><h3 id="EventPhase.CHANGE" class="add-link hide-from-toc">CHANGE</h3></td>
<td><code>2</code></td>
<td><p>The device has reported an update to the pointer state.</p>
</td>
</tr>
<tr id="EventPhase.REMOVE">
<td><h3 id="EventPhase.REMOVE" class="add-link hide-from-toc">REMOVE</h3></td>
<td><code>3</code></td>
<td><p>The device has stopped tracking the pointer.</p>
</td>
</tr>
<tr id="EventPhase.CANCEL">
<td><h3 id="EventPhase.CANCEL" class="add-link hide-from-toc">CANCEL</h3></td>
<td><code>4</code></td>
<td><p>The pointer is no longer available.</p>
</td>
</tr>
</table>
### MouseViewStatus [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#MouseViewStatus data-text="MouseViewStatus"}
Type: <code>uint32</code>
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=177)*
<p>A description of mouse event stream's relationship to this view.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="MouseViewStatus.ENTERED">
<td><h3 id="MouseViewStatus.ENTERED" class="add-link hide-from-toc">ENTERED</h3></td>
<td><code>1</code></td>
<td><p>The stream is directed towards this view.</p>
</td>
</tr>
<tr id="MouseViewStatus.EXITED">
<td><h3 id="MouseViewStatus.EXITED" class="add-link hide-from-toc">EXITED</h3></td>
<td><code>2</code></td>
<td><p>The stream is directed away from this view.</p>
</td>
</tr>
</table>
### TouchInteractionStatus [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TouchInteractionStatus data-text="TouchInteractionStatus"}
Type: <code>uint32</code>
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=194)*
<p>A description of the interaction's relationship to this client.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="TouchInteractionStatus.DENIED">
<td><h3 id="TouchInteractionStatus.DENIED" class="add-link hide-from-toc">DENIED</h3></td>
<td><code>1</code></td>
<td><p>The client has been denied ownership of the interaction.</p>
</td>
</tr>
<tr id="TouchInteractionStatus.GRANTED">
<td><h3 id="TouchInteractionStatus.GRANTED" class="add-link hide-from-toc">GRANTED</h3></td>
<td><code>2</code></td>
<td><p>The client has been granted ownership of the interaction.</p>
</td>
</tr>
</table>
### TouchResponseType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TouchResponseType data-text="TouchResponseType"}
Type: <code>uint32</code>
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=222)*
<p>The possible interaction dispositions that a client can respond with to a
given |TouchPointerSample|. Used as part of a gesture disambiguation scheme.</p>
<p>The responses are based on the idea of an ownership claim on a interaction.
Clients may assert a claim of ownership on an open interaction, but only one
client's claim is granted by the server; other clients' claims are denied.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="TouchResponseType.NO">
<td><h3 id="TouchResponseType.NO" class="add-link hide-from-toc">NO</h3></td>
<td><code>1</code></td>
<td><p>The client has no further interest in this interaction; it declines
ownership of the interaction. The client will stop receiving events for
this interaction.</p>
</td>
</tr>
<tr id="TouchResponseType.MAYBE">
<td><h3 id="TouchResponseType.MAYBE" class="add-link hide-from-toc">MAYBE</h3></td>
<td><code>2</code></td>
<td><p>The client is interested in this interaction, but needs to see more
events to decide; the client has not yet claimed ownership of this
interaction.</p>
</td>
</tr>
<tr id="TouchResponseType.MAYBE_PRIORITIZE">
<td><h3 id="TouchResponseType.MAYBE_PRIORITIZE" class="add-link hide-from-toc">MAYBE_PRIORITIZE</h3></td>
<td><code>3</code></td>
<td><p>The client is interested in this interaction, but needs to see more
events to decide; the client has not yet claimed ownership of the
interaction. During ownership resolution, it exerts its priority over
lower-priority &quot;maybe&quot; claims, but always loses to a &quot;yes&quot; claim.</p>
</td>
</tr>
<tr id="TouchResponseType.MAYBE_SUPPRESS">
<td><h3 id="TouchResponseType.MAYBE_SUPPRESS" class="add-link hide-from-toc">MAYBE_SUPPRESS</h3></td>
<td><code>4</code></td>
<td><p>The client is interested in this interaction, but needs to see more
events to decide; the client has not yet claimed ownership of the
interaction. Moreover, it suppresses lower-priority claims that try to
resolve interaction ownership.</p>
</td>
</tr>
<tr id="TouchResponseType.MAYBE_PRIORITIZE_SUPPRESS">
<td><h3 id="TouchResponseType.MAYBE_PRIORITIZE_SUPPRESS" class="add-link hide-from-toc">MAYBE_PRIORITIZE_SUPPRESS</h3></td>
<td><code>5</code></td>
<td><p>The client is interested in this interaction, but needs to see more
events to decide; the client has not yet claimed ownership of the
interaction. Moreover, it suppresses lower-priority claims that try to
resolve interaction ownership. During ownership resolution, it exerts
its priority over lower-priority &quot;maybe&quot; claims, but always loses to a
&quot;yes&quot; claim.</p>
</td>
</tr>
<tr id="TouchResponseType.HOLD">
<td><h3 id="TouchResponseType.HOLD" class="add-link hide-from-toc">HOLD</h3></td>
<td><code>6</code></td>
<td><p>The client is interested in this interaction, but needs to see a
subsequent interaction to decide; the client has not yet claimed
ownership of this interaction. It prevents ownership resolution when the
interaction closes.</p>
</td>
</tr>
<tr id="TouchResponseType.HOLD_SUPPRESS">
<td><h3 id="TouchResponseType.HOLD_SUPPRESS" class="add-link hide-from-toc">HOLD_SUPPRESS</h3></td>
<td><code>7</code></td>
<td><p>The client is interested in this interaction, but needs to see a
subsequent interaction to decide; the client has not yet claimed
ownership of this interaction. It prevents ownership resolution when the
interaction closes. Moreover, it suppresses lower-priority claims that
try to resolve interaction ownership.</p>
</td>
</tr>
<tr id="TouchResponseType.YES">
<td><h3 id="TouchResponseType.YES" class="add-link hide-from-toc">YES</h3></td>
<td><code>8</code></td>
<td><p>The client wishes exclusive access to the remaining events in this
interaction; it claims ownership of this interaction (but that claim may
be granted or denied). During ownership resolution, it yields its
priority to lower-priority &quot;yes&quot; claims.</p>
</td>
</tr>
<tr id="TouchResponseType.YES_PRIORITIZE">
<td><h3 id="TouchResponseType.YES_PRIORITIZE" class="add-link hide-from-toc">YES_PRIORITIZE</h3></td>
<td><code>9</code></td>
<td><p>The client wishes exclusive access to the remaining events in this
interaction; it claims ownership of this interaction (but that claim may
be granted or denied). During ownership resolution, it exerts its
priority over lower-priority &quot;yes&quot; claims.</p>
</td>
</tr>
</table>
## **TABLES**
### MouseDeviceInfo {#MouseDeviceInfo data-text="MouseDeviceInfo"}
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=97)*
<p>Information about a device that issues a mouse event stream.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="MouseDeviceInfo.id">
<td><h3 id="MouseDeviceInfo.id" class="add-link hide-from-toc">1</h3></td>
<td><code>id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier for the mouse device that issues a mouse event stream.
Required.</p>
</td>
</tr>
<tr id="MouseDeviceInfo.scroll_v_range">
<td><h3 id="MouseDeviceInfo.scroll_v_range" class="add-link hide-from-toc">2</h3></td>
<td><code>scroll_v_range</code></td>
<td>
<code><a class='link' href='../fuchsia.input.report/'>fuchsia.input.report</a>/<a class='link' href='../fuchsia.input.report/#Axis'>Axis</a></code>
</td>
<td><p>Range of vertical scroll values issued by the device.</p>
</td>
</tr>
<tr id="MouseDeviceInfo.scroll_h_range">
<td><h3 id="MouseDeviceInfo.scroll_h_range" class="add-link hide-from-toc">3</h3></td>
<td><code>scroll_h_range</code></td>
<td>
<code><a class='link' href='../fuchsia.input.report/'>fuchsia.input.report</a>/<a class='link' href='../fuchsia.input.report/#Axis'>Axis</a></code>
</td>
<td><p>Range of horizontal scroll values issued by the device.</p>
</td>
</tr>
<tr id="MouseDeviceInfo.buttons">
<td><h3 id="MouseDeviceInfo.buttons" class="add-link hide-from-toc">4</h3></td>
<td><code>buttons</code></td>
<td>
<code>vector&lt;uint8&gt;[32]</code>
</td>
<td><p>Button identifiers issued by the device, in priority order.</p>
</td>
</tr>
<tr id="MouseDeviceInfo.relative_motion_range">
<td><h3 id="MouseDeviceInfo.relative_motion_range" class="add-link hide-from-toc">5</h3></td>
<td><code>relative_motion_range</code></td>
<td>
<code><a class='link' href='#RelativeMotionRange'>RelativeMotionRange</a></code>
</td>
<td><p>Range of relative movement values issued by the device.</p>
</td>
</tr>
</table>
### MouseEvent {#MouseEvent data-text="MouseEvent"}
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=57)*
<p>The self-sufficient, self-consistent collection of pointer-related data,
sent from server to client.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="MouseEvent.timestamp">
<td><h3 id="MouseEvent.timestamp" class="add-link hide-from-toc">1</h3></td>
<td><code>timestamp</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code>
</td>
<td><p>The time this event was observed.
Required.</p>
</td>
</tr>
<tr id="MouseEvent.view_parameters">
<td><h3 id="MouseEvent.view_parameters" class="add-link hide-from-toc">2</h3></td>
<td><code>view_parameters</code></td>
<td>
<code><a class='link' href='#ViewParameters'>ViewParameters</a></code>
</td>
<td><p>The parameters of the associated view and viewport, sufficient to
correctly interpret the position, orientation, magnitude, and
inter-event distance of pointer events dispatched to a view.</p>
<ul>
<li>It is issued on connection and on change.</li>
</ul>
</td>
</tr>
<tr id="MouseEvent.device_info">
<td><h3 id="MouseEvent.device_info" class="add-link hide-from-toc">3</h3></td>
<td><code>device_info</code></td>
<td>
<code><a class='link' href='#MouseDeviceInfo'>MouseDeviceInfo</a></code>
</td>
<td><p>A description of the mouse device, sufficient to correctly interpret
the capabilities and usage intent of the device.</p>
<ul>
<li>It is issued once per device.</li>
</ul>
</td>
</tr>
<tr id="MouseEvent.pointer_sample">
<td><h3 id="MouseEvent.pointer_sample" class="add-link hide-from-toc">4</h3></td>
<td><code>pointer_sample</code></td>
<td>
<code><a class='link' href='#MousePointerSample'>MousePointerSample</a></code>
</td>
<td><p>A description of each sampled data point in a mouse event stream.</p>
<p>Issuance policy. There are two dispatch modes, &quot;hover&quot; and &quot;latched&quot;.
Hover mode is default, and the stream is dispatched in fragments to the
visible client that each mouse event hovers above. Latched mode directs
the stream to a single client (regardless of view boundary) until
unlatched. Latched mode is typically toggled when the user presses the
primary mouse button, but is ultimately a product-specific policy.</p>
</td>
</tr>
<tr id="MouseEvent.stream_info">
<td><h3 id="MouseEvent.stream_info" class="add-link hide-from-toc">5</h3></td>
<td><code>stream_info</code></td>
<td>
<code><a class='link' href='#MouseEventStreamInfo'>MouseEventStreamInfo</a></code>
</td>
<td><p>The signal for view entry/exit in hover mode.</p>
<ul>
<li>It is issued on hover entry into a view, and hover exit from a view.</li>
</ul>
</td>
</tr>
<tr id="MouseEvent.trace_flow_id">
<td><h3 id="MouseEvent.trace_flow_id" class="add-link hide-from-toc">6</h3></td>
<td><code>trace_flow_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>An identifier to correlate this event's send/receive occurrence across
component boundaries or abstraction layers.</p>
</td>
</tr>
</table>
### MousePointerSample {#MousePointerSample data-text="MousePointerSample"}
*Defined in [fuchsia.ui.pointer/mouse.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=127)*
<p>A description of each sampled data point in a mouse event stream.</p>
<p><code>MousePointerSample</code> may bundle multiple state changes into one event.
For example, if user scrolls mouse wheel and presses the left buttton
down at the same time, client may receive scroll and button state changes
together in 1 event, or receive button change and scroll change in
separate events.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="MousePointerSample.device_id">
<td><h3 id="MousePointerSample.device_id" class="add-link hide-from-toc">1</h3></td>
<td><code>device_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier for the mouse device that issues a mouse event stream.
Required.</p>
</td>
</tr>
<tr id="MousePointerSample.position_in_viewport">
<td><h3 id="MousePointerSample.position_in_viewport" class="add-link hide-from-toc">2</h3></td>
<td><code>position_in_viewport</code></td>
<td>
<code><a class='link' href='#Point2'>Point2</a></code>
</td>
<td><p>The position of this event, in the viewport's coordinate system.
Required.</p>
</td>
</tr>
<tr id="MousePointerSample.scroll_v">
<td><h3 id="MousePointerSample.scroll_v" class="add-link hide-from-toc">3</h3></td>
<td><code>scroll_v</code></td>
<td>
<code>int64</code>
</td>
<td><p>Relative vertical scrolling displacement by detent.</p>
</td>
</tr>
<tr id="MousePointerSample.scroll_h">
<td><h3 id="MousePointerSample.scroll_h" class="add-link hide-from-toc">4</h3></td>
<td><code>scroll_h</code></td>
<td>
<code>int64</code>
</td>
<td><p>Relative horizontal scrolling displacement by detent.</p>
</td>
</tr>
<tr id="MousePointerSample.pressed_buttons">
<td><h3 id="MousePointerSample.pressed_buttons" class="add-link hide-from-toc">5</h3></td>
<td><code>pressed_buttons</code></td>
<td>
<code>vector&lt;uint8&gt;[32]</code>
</td>
<td><p>Identifiers of currently pressed buttons.</p>
</td>
</tr>
<tr id="MousePointerSample.relative_motion">
<td><h3 id="MousePointerSample.relative_motion" class="add-link hide-from-toc">6</h3></td>
<td><code>relative_motion</code></td>
<td>
<code><a class='link' href='#RelativeMotion'>RelativeMotion</a></code>
</td>
<td><p>The relative movement performed, independent of the viewport's
coordinate system.</p>
</td>
</tr>
<tr id="MousePointerSample.scroll_v_physical_pixel">
<td><h3 id="MousePointerSample.scroll_v_physical_pixel" class="add-link hide-from-toc">7</h3></td>
<td><code>scroll_v_physical_pixel</code></td>
<td>
<code>float64</code>
</td>
<td><p>Recommended vertical scrolling displacement by physical pixel, it is
computed with accelerator, detent / mm to pixel ratio, etc.</p>
</td>
</tr>
<tr id="MousePointerSample.scroll_h_physical_pixel">
<td><h3 id="MousePointerSample.scroll_h_physical_pixel" class="add-link hide-from-toc">8</h3></td>
<td><code>scroll_h_physical_pixel</code></td>
<td>
<code>float64</code>
</td>
<td><p>Recommended horizontal scrolling displacement by physical pixel, it
is computed with accelerator, detent / mm to pixel ratio, etc.</p>
</td>
</tr>
<tr id="MousePointerSample.is_precision_scroll">
<td><h3 id="MousePointerSample.is_precision_scroll" class="add-link hide-from-toc">9</h3></td>
<td><code>is_precision_scroll</code></td>
<td>
<code>bool</code>
</td>
<td><p>Indicated if the scroll event is from a precision scroll device (HI_RES
mouse or touchpad). Clients may want to play interpolation animations
on non precision scroll device for smooth scrolling.</p>
</td>
</tr>
</table>
### TouchDeviceInfo {#TouchDeviceInfo data-text="TouchDeviceInfo"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=127)*
<p>Information about a device that issues touch event streams.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TouchDeviceInfo.id">
<td><h3 id="TouchDeviceInfo.id" class="add-link hide-from-toc">1</h3></td>
<td><code>id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>An identifier for the touch device that issues touch event streams.
A device may own multiple pointers, each with its own pointer id and its
own touch event stream.
Required.</p>
</td>
</tr>
</table>
### TouchEvent {#TouchEvent data-text="TouchEvent"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=96)*
<p>The self-sufficient, self-consistent collection of pointer-related data,
sent from server to client.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TouchEvent.timestamp">
<td><h3 id="TouchEvent.timestamp" class="add-link hide-from-toc">1</h3></td>
<td><code>timestamp</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code>
</td>
<td><p>The time this event was observed.
Required.</p>
</td>
</tr>
<tr id="TouchEvent.view_parameters">
<td><h3 id="TouchEvent.view_parameters" class="add-link hide-from-toc">2</h3></td>
<td><code>view_parameters</code></td>
<td>
<code><a class='link' href='#ViewParameters'>ViewParameters</a></code>
</td>
<td><p>The parameters of the associated view and viewport, sufficient to
correctly interpret the position, orientation, magnitude, and
inter-event distance of touch events dispatched to a view.</p>
<ul>
<li>It is issued on connection and on change.</li>
</ul>
</td>
</tr>
<tr id="TouchEvent.device_info">
<td><h3 id="TouchEvent.device_info" class="add-link hide-from-toc">3</h3></td>
<td><code>device_info</code></td>
<td>
<code><a class='link' href='#TouchDeviceInfo'>TouchDeviceInfo</a></code>
</td>
<td><p>A description of the pointer device, sufficient to correctly interpret
the capabilities and usage intent of the device.</p>
<ul>
<li>It is issued once per device.</li>
</ul>
</td>
</tr>
<tr id="TouchEvent.pointer_sample">
<td><h3 id="TouchEvent.pointer_sample" class="add-link hide-from-toc">4</h3></td>
<td><code>pointer_sample</code></td>
<td>
<code><a class='link' href='#TouchPointerSample'>TouchPointerSample</a></code>
</td>
<td><p>A description of each sampled data point in an interaction of touch
events.</p>
<ul>
<li>It is issued on every sample in the interaction.</li>
</ul>
</td>
</tr>
<tr id="TouchEvent.interaction_result">
<td><h3 id="TouchEvent.interaction_result" class="add-link hide-from-toc">5</h3></td>
<td><code>interaction_result</code></td>
<td>
<code><a class='link' href='#TouchInteractionResult'>TouchInteractionResult</a></code>
</td>
<td><p>The result of gesture disambiguation for a interaction of touch events.</p>
<ul>
<li>It is issued once per interaction.</li>
</ul>
</td>
</tr>
<tr id="TouchEvent.trace_flow_id">
<td><h3 id="TouchEvent.trace_flow_id" class="add-link hide-from-toc">6</h3></td>
<td><code>trace_flow_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>An identifier to correlate this event's send/receive occurrence across
component boundaries or abstraction layers.</p>
</td>
</tr>
</table>
### TouchPointerSample {#TouchPointerSample data-text="TouchPointerSample"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=172)*
<p>A description of each sampled data point in a touch event stream.
All fields are required.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TouchPointerSample.interaction">
<td><h3 id="TouchPointerSample.interaction" class="add-link hide-from-toc">1</h3></td>
<td><code>interaction</code></td>
<td>
<code><a class='link' href='#TouchInteractionId'>TouchInteractionId</a></code>
</td>
<td><p>The interaction that this pointer sample belongs to.</p>
</td>
</tr>
<tr id="TouchPointerSample.phase">
<td><h3 id="TouchPointerSample.phase" class="add-link hide-from-toc">2</h3></td>
<td><code>phase</code></td>
<td>
<code><a class='link' href='#EventPhase'>EventPhase</a></code>
</td>
<td><p>The state of this event in the interaction's state machine.</p>
</td>
</tr>
<tr id="TouchPointerSample.position_in_viewport">
<td><h3 id="TouchPointerSample.position_in_viewport" class="add-link hide-from-toc">3</h3></td>
<td><code>position_in_viewport</code></td>
<td>
<code><a class='link' href='#Point2'>Point2</a></code>
</td>
<td><p>The position of this event, in the viewport's coordinate system.</p>
</td>
</tr>
</table>
### TouchResponse {#TouchResponse data-text="TouchResponse"}
*Defined in [fuchsia.ui.pointer/touch.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=206)*
<p>A feedback event per |Event|, sent from client to server.</p>
<p>Only |TouchPointerSample| requires a |TouchResponseType|; for other events,
the server expects an empty |TouchResponse| table.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="TouchResponse.response_type">
<td><h3 id="TouchResponse.response_type" class="add-link hide-from-toc">1</h3></td>
<td><code>response_type</code></td>
<td>
<code><a class='link' href='#TouchResponseType'>TouchResponseType</a></code>
</td>
<td><p>The interaction disposition that a client responds with for a given
|TouchPointerSample|.</p>
</td>
</tr>
<tr id="TouchResponse.trace_flow_id">
<td><h3 id="TouchResponse.trace_flow_id" class="add-link hide-from-toc">2</h3></td>
<td><code>trace_flow_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>An identifier to correlate this response's send/receive occurrence across
component boundaries or abstraction layers.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="MOUSE_MAX_EVENT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=9">MOUSE_MAX_EVENT</a></td>
<td>
<code>128</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="TOUCH_MAX_EVENT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/touch.fidl;l=8">TOUCH_MAX_EVENT</a></td>
<td>
<code>128</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
</table>
## **ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Mat3">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/view.fidl;l=8">Mat3</a></td>
<td>
<code>array</code>[<code>9</code>]</td>
<td><p>A floating-point 3x3 matrix.</p>
<ul>
<li>The values are placed in column-major order.</li>
</ul>
</td>
</tr>
<tr id="Point2">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/view.fidl;l=12">Point2</a></td>
<td>
<code>array</code>[<code>2</code>]</td>
<td><p>A floating-point two-dimensional point.</p>
<ul>
<li>The values are placed in (x, y) order.</li>
</ul>
</td>
</tr>
<tr id="RelativeMotion">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=118">RelativeMotion</a></td>
<td>
<code>array</code>[<code>2</code>]</td>
<td><p>The relative motion performed by a mouse device.</p>
<ul>
<li>The valid range is defined in <a class='link' href='#MouseDeviceInfo.RelativeMotionRange'>MouseDeviceInfo.RelativeMotionRange</a>.</li>
<li>The values are placed in (x, y) order.</li>
</ul>
</td>
</tr>
<tr id="RelativeMotionRange">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.pointer/mouse.fidl;l=94">RelativeMotionRange</a></td>
<td>
<code>array</code>[<code>2</code>]</td>
<td><p>The valid values of relative motion for a mouse device.</p>
<ul>
<li>The ranges are placed in (x, y) order.</li>
</ul>
</td>
</tr>
</table>