blob: 26c9fe95ab07951260328862ed8f6632e51baf68 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.accessibility.gesture
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## Listener {#Listener}
*Defined in [fuchsia.accessibility.gesture/gesture_listener.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.gesture/gesture_listener.fidl;l=38)*
<p>An interface to listen for accessibility gestures.</p>
<p>Accessibility services offer a set of gestures defined in Type above, which
can be targeted by a system UI.
Generally, in a touch screen system, there is a set of system-wide gestures
which can be performed anywhere, triggering an action that changes some
state of the UI.
For example, some can offer a way to close an application and go back to
their home screen, while others can offer a way to bring a list of running
applications that users can choose from.
Because those gestures can conflict with assistive technology gestures,
accessibility services offer some alternative ones which can be bound to the
UI actions.</p>
### OnGesture {#Listener.OnGesture}
<p>When accessibility services detect a gesture, the listener is informed
of which gesture was performed. The listener has the chance to handle
the gesture, setting the result in |handled|. In addition, an
|utterance| is also passed back to accessibility, with a custom message
to be spoken. The message is expected to be localized, matching the
same locale that the UI component is displaying its content.
If the utterance is empty, it is assumed that no spoken output is
necessary to describe the result of the action.</p>
#### Request {#Listener.OnGesture_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>gesture_type</code></td>
<td>
<code><a class='link' href='#Type'>Type</a></code>
</td>
</tr>
</table>
#### Response {#Listener.OnGesture_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>handled</code></td>
<td>
<code>bool</code>
</td>
</tr>
<tr>
<td><code>utterance</code></td>
<td>
<code>string[16384]?</code>
</td>
</tr>
</table>
## ListenerRegistry {#ListenerRegistry}
*Defined in [fuchsia.accessibility.gesture/gesture_listener.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.gesture/gesture_listener.fidl;l=57)*
<p>An interface for registering a listener of accessibility gestures.</p>
### Register {#ListenerRegistry.Register}
<p>A UI registers itself to start listening for accessibility gestures
through <code>listener</code>.
Only one listener can be registered at a time.
This registry honors the last Register() call, and a previous listener
is closed.
In case of any failure, the channel of the listener is closed with an
epitaph.</p>
#### Request {#ListenerRegistry.Register_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>listener</code></td>
<td>
<code><a class='link' href='#Listener'>Listener</a></code>
</td>
</tr>
</table>
#### Response {#ListenerRegistry.Register_Response}
&lt;EMPTY&gt;
## **ENUMS**
### Type [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Type data-text="Type"}
Type: <code>uint32</code>
*Defined in [fuchsia.accessibility.gesture/gesture_listener.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.gesture/gesture_listener.fidl;l=14)*
<p>Gestures types that accessibility offers to a UI component for listening.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Type.THREE_FINGER_SWIPE_UP">
<td><h3 id="Type.THREE_FINGER_SWIPE_UP" class="add-link hide-from-toc">THREE_FINGER_SWIPE_UP</h3></td>
<td><code>1</code></td>
<td><p>A three-finger swipe up.</p>
</td>
</tr>
<tr id="Type.THREE_FINGER_SWIPE_DOWN">
<td><h3 id="Type.THREE_FINGER_SWIPE_DOWN" class="add-link hide-from-toc">THREE_FINGER_SWIPE_DOWN</h3></td>
<td><code>2</code></td>
<td><p>A three-finger swipe down.</p>
</td>
</tr>
<tr id="Type.THREE_FINGER_SWIPE_RIGHT">
<td><h3 id="Type.THREE_FINGER_SWIPE_RIGHT" class="add-link hide-from-toc">THREE_FINGER_SWIPE_RIGHT</h3></td>
<td><code>3</code></td>
<td><p>A three-finger swipe right.</p>
</td>
</tr>
<tr id="Type.THREE_FINGER_SWIPE_LEFT">
<td><h3 id="Type.THREE_FINGER_SWIPE_LEFT" class="add-link hide-from-toc">THREE_FINGER_SWIPE_LEFT</h3></td>
<td><code>4</code></td>
<td><p>A three-finger swipe left.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="MAX_UTTERANCE_SIZE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.gesture/gesture_listener.fidl;l=11">MAX_UTTERANCE_SIZE</a></td>
<td>
<code>16384</code>
</td>
<td><code>uint64</code></td>
<td><p>Maximum size of a returned utterance.</p>
</td>
</tr>
</table>