fuchsia.ui.test.input

Added: 9

PROTOCOLS

Keyboard

Defined in fuchsia.ui.test.input/text.fidl

A tool to inject keyboard events into Input Pipeline.

Please extend as necessary.

SimulateKeyEvent

Simulate a key event by a keyboard input report.

KeyboardInputReport includes a list of keys that are currently pressing down. The report can represent key down / up by comparing with previous reports received.

Added: 16

Request

NameType
payload KeyboardSimulateKeyEventRequest

Response

<EMPTY>

SimulateUsAsciiTextEntry

Simulates input of the set of keystrokes required to type text, as if on a US QWERTY keyboard.

US ASCII text get mapped to the corresponding key presses. For example a gets mapped into a press and a followup release of the key a on the US QWERTY keyboard. Also, A gets mapped into a press of the Shift key, followed by a press and release of a.

For convenience, the \n and \t get converted into Enter and Tab keys respectively.

Request

NameType
payload KeyboardSimulateUsAsciiTextEntryRequest

Response

<EMPTY>

KeyboardInputListener

Defined in fuchsia.ui.test.input/text.fidl

A tool for client applications to report text input to interested parties (e.g. a test fixture).

NOTE: The reporter is the client of this service.

Canonical usage is for a test to inject text via fuchsia.ui.test.input.Keyboad, and wait for the client under test to report back that it received the injected text via fuchsia.ui.test.input.KeyboardInputListener.

NOTE: This protocol is implemented by OOT code. Use versioning to make changes to this protocol.

ReportReady

Notify that the client is ready to receive text input. Clients that need to complete their setup to be able to continue with testing should call this method, so that the listener can wait until they are ready to proceed with testing.

Added: 10

Request

<EMPTY>

Response

<EMPTY>

ReportTextInput

Notify the listener of the text string generated by the set of key events received by the application.

Request

NameType
payload KeyboardInputListenerReportTextInputRequest

MediaButtonsDevice

Defined in fuchsia.ui.test.input/media_buttons.fidl

A tool to inject media button events into Input Pipeline.

Please extend as necessary.

SendButtonsState

Send a vector of pressing button on the requested button on the device. Passing empty vector will release all pressing buttons.

Added: 19

Request

NameType
payload MediaButtonsDeviceSendButtonsStateRequest

Response

<EMPTY>

SimulateButtonPress

Simulates a button press and release on the requested button on the device.

Request

NameType
payload MediaButtonsDeviceSimulateButtonPressRequest

Response

<EMPTY>

Mouse

Defined in fuchsia.ui.test.input/mouse.fidl

A tool to inject mouse events into Input Pipeline.

Please extend as necessary.

SimulateMouseEvent

Injects an input report corresponding to the event specified.

NOTE: the movement parameters have a range of [-1000, 1000], and the scroll parameters have a range of [-100, 100].

Request

NameType
payload MouseSimulateMouseEventRequest

Response

<EMPTY>

MouseInputListener

Defined in fuchsia.ui.test.input/mouse.fidl

A tool for applications to report touch input to interested parties (e.g. a test fixture).

ReportMouseInput

Report that component under test has received expected input.

Request

NameType
payload MouseInputListenerReportMouseInputRequest

Registry

Defined in fuchsia.ui.test.input/registry.fidl

*** This protocol must not be used in production. ***

Enables clients to register fake input devices, which can be used to inject input events directly into Input Pipeline.

RegisterKeyboard

Enables the client to inject keyboard events using the corresponding client end to device.

Clients are allowed at most one in-flight call at a time. Subsequent calls must wait until the acknowledgment returns. Non-compliance results in channel closure.

The fuchsia.ui.test.input.Keyboard channel will remain open even if the Registry connection closes.

Request

NameType
payload RegistryRegisterKeyboardRequest

Response

<EMPTY>

RegisterMediaButtonsDevice

Enables the client to inject media buttons events using the corresponding client end to device.

Clients are allowed at most one in-flight call at a time. Subsequent calls must wait until the acknowledgment returns. Non-compliance results in channel closure.

The fuchsia.ui.test.input.MediaButtonsDevice channel will remain open even if the Registry connection closes.

Request

NameType
payload RegistryRegisterMediaButtonsDeviceRequest

Response

<EMPTY>

RegisterMouse

Enables the client to inject mouse events using the corresponding client end to device.

Clients are allowed at most one in-flight call at a time. Subsequent calls must wait until the acknowledgment returns. Non-compliance results in channel closure.

The fuchsia.ui.test.input.Mouse channel will remain open even if the Registry connection closes.

Request

NameType
payload RegistryRegisterMouseRequest

Response

<EMPTY>

RegisterTouchScreen

Enables the client to inject touch events using the corresponding client end to device.

Clients are allowed at most one in-flight call at a time. Subsequent calls must wait until the acknowledgment returns. Non-compliance results in channel closure.

The fuchsia.ui.test.input.TouchScreen channel will remain open even if the Registry connection closes.

Request

NameType
payload RegistryRegisterTouchScreenRequest

Response

<EMPTY>

TouchInputListener

Defined in fuchsia.ui.test.input/touch.fidl

A tool for applications to report touch input to interested parties (e.g. a test fixture).

ReportTouchInput

Report that component under test has received expected input.

Request

NameType
payload TouchInputListenerReportTouchInputRequest

TouchScreen

Defined in fuchsia.ui.test.input/touch.fidl

A tool to inject touch events into Input Pipeline.

Please extend as necessary.

SimulateMultiFingerGesture

Simulates a multi fingers linear gesture that starts at start_locations and ends at end_locations, with a total number of move events equal to move_event_count. if the arguments are invalid, the server should close the connection.

The generated pointer event stream will be:

DOWN + CHANGE_1 + ... + CHANGE_n + UP, where n == move_event_count

Events are injected with a small explicit delay in between.

Added: 12

Request

NameType
payload TouchScreenSimulateMultiFingerGestureRequest

Response

<EMPTY>

SimulateMultiTap

Simulates multi finger tap at the requested locations.

Added: 12

Request

NameType
payload TouchScreenSimulateMultiTapRequest

Response

<EMPTY>

SimulateSwipe

Simulates a swipe that starts at start_location and ends at end_location, with a total number of move events equal to move_event_count.

The generated pointer event stream will be:

DOWN + CHANGE_1 + ... + CHANGE_n + UP, where n == move_event_count

Events are injected with no explicit delay in between; in other words, the observed delay between successive events will be approximately equal to the time required to inject a single event.

Request

NameType
payload TouchScreenSimulateSwipeRequest

Response

<EMPTY>

SimulateTap

Simulates a tap at the requested location.

Request

NameType
payload TouchScreenSimulateTapRequest

Response

<EMPTY>

SimulateTouchEvent

Simulate a touch event by a touch input report.

TouchInputReport includes a list of contacts that are currently contacting the touch surface. The report can represent multiply touch events by comparing with previous reports received.

Added: 17

Request

NameType
report fuchsia.input.report/TouchInputReport

Response

<EMPTY>

ENUMS

CoordinateUnit flexible

Type: uint32

Defined in fuchsia.ui.test.input/registry.fidl

Indicates the units used to specify spatial event parameters (unless otherwise noted).

Added: 11

NameValueDescription
0

The physical display is mapped to a coordinate space spanning [-1000, 1000] on both the x and y axes, where positive x extends rightward and positive y extends downward.

Example: (500, -500) in the default coordinate space maps to the center of the top-right quadrant of the physical display.

1

The physical display is mapped to a coordinate space spanning (0, 0) - (dispaly width, display height), where positive x extends rightward and positive y extends downward.

Test writers should use fuchsia.ui.display.singleton.Info to retrieve the physical dimensions of the display.

Note that this space matches both the size AND orientation of the physical display, so it will NOT mirror any rotations applied to the scene graph.

In general, test writers should NOT assume that a particular view's logical coordinate space matches the physical coordinate space.

MouseButton flexible

Type: uint32

Defined in fuchsia.ui.test.input/mouse.fidl

Identifies various buttons on a standard mouse.

NameValueDescription
0

"Left" mouse button.

1

"Right" mouse button.

2

"Third" mouse button.

MouseEventPhase flexible

Type: uint32

Defined in fuchsia.ui.test.input/mouse.fidl

Identifies the phase of a mouse event.

NameValueDescription
0

The observer has started tracking the mouse.

1

The mouse has moved since the last ADD event, without an interceding DOWN event.

2

One or more mouse buttons have been pressed.

3

The mouse has moved since the last DOWN event.

4

All pressed buttons have been released.

5

The mouse wheel was manipulated.

TABLES

KeyboardInputListenerReportTextInputRequest

Defined in fuchsia.ui.test.input/text.fidl

OrdinalFieldTypeDescription
text string[1024]

The content of the text input received by the reporter.

non_printable fuchsia.ui.input3/NonPrintableKey

The non printable key received by the reporter.

Added: 18

KeyboardSimulateKeyEventRequest

Defined in fuchsia.ui.test.input/text.fidl

OrdinalFieldTypeDescription
report fuchsia.input.report/KeyboardInputReport

KeyboardSimulateUsAsciiTextEntryRequest

Defined in fuchsia.ui.test.input/text.fidl

OrdinalFieldTypeDescription
text string[1024]

MediaButtonsDeviceSendButtonsStateRequest

Defined in fuchsia.ui.test.input/media_buttons.fidl

OrdinalFieldTypeDescription
buttons vector<fuchsia.input.report/ConsumerControlButton>[255]

The button receiving the button press.

MediaButtonsDeviceSimulateButtonPressRequest

Defined in fuchsia.ui.test.input/media_buttons.fidl

OrdinalFieldTypeDescription
button fuchsia.input.report/ConsumerControlButton

The button receiving the button press.

MouseInputListenerReportMouseInputRequest

Defined in fuchsia.ui.test.input/mouse.fidl

OrdinalFieldTypeDescription
local_x float64

The horizontal coordinate in the reporter's coordinate system.

local_y float64

The vertical coordinate in the reporter's coordinate system.

time_received zx/Time

The monotonic time (ns) the mouse event was received by the client. Note that this value should be used with caution. Some reporters may not be capable of ns-level precision, but still report in ns-level units.

component_name string[1024]

Name of the component to help distinguish responses from multiple components.

NOTE: This name is independent of component framework, so the reporter and listener are free to agree on an arbitrary value.

buttons vector<MouseButton>[32]

The pressed buttons that the reporter received.

phase MouseEventPhase

The phase of the mouse event that the reporter received.

device_pixel_ratio float64

The device pixel ratio of which the reporter is aware.

Some reporters may account for this scale factor when converting to local coordinates.

wheel_x_physical_pixel float64

The horizontal wheel scroll delta in physical pixels.

wheel_y_physical_pixel float64

The vertical wheel scroll delta in physical pixels.

MouseSimulateMouseEventRequest

Defined in fuchsia.ui.test.input/mouse.fidl

OrdinalFieldTypeDescription
pressed_buttons vector<MouseButton>[32]

Set of buttons that are currently pressed. Must NOT contain duplicates.

movement_x int64

Relative X positional displacement.

movement_y int64

Relative Y positional displacement.

scroll_v_detent int64

Relative vertical scrolling displacement by detent.

scroll_h_detent int64

Relative horizontal scrolling displacement by detent.

scroll_v_physical_pixel float64

Recommended vertical scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc.

scroll_h_physical_pixel float64

Recommended horizontal scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc.

RegistryRegisterKeyboardRequest resource

Defined in fuchsia.ui.test.input/registry.fidl

OrdinalFieldTypeDescription
device server_end<Keyboard>

RegistryRegisterMediaButtonsDeviceRequest resource

Defined in fuchsia.ui.test.input/registry.fidl

OrdinalFieldTypeDescription
device server_end<MediaButtonsDevice>

RegistryRegisterMouseRequest resource

Defined in fuchsia.ui.test.input/registry.fidl

OrdinalFieldTypeDescription
device server_end<Mouse>

RegistryRegisterTouchScreenRequest resource

Defined in fuchsia.ui.test.input/registry.fidl

OrdinalFieldTypeDescription
device server_end<TouchScreen>
coordinate_unit CoordinateUnit

Indicates the coordinate space in which to describe touch events.

Added: 11

TouchInputListenerReportTouchInputRequest

Defined in fuchsia.ui.test.input/touch.fidl

OrdinalFieldTypeDescription
local_x float64

The horizontal coordinate, in the reporter's coordinate system.

local_y float64

The vertical coordinate, in the reporter's coordinate system.

time_received zx/Time

The monotonic time (ns) the pointer data was received by the reporter. Note that this value should be used with caution. Some reporters may not be capable of ns-level precision, but still report in ns-level units.

device_pixel_ratio float64

The number of physical pixels, per logical pixel, as reported by the reporter.

component_name string[1024]

Name of the component to help distinguish responses from multiple components.

NOTE: This name is independent of component framework, so the reporter and listener are free to agree on an arbitrary value.

phase fuchsia.ui.pointer/EventPhase

The phase of the touch event.

Added: 12
pointer_id uint32

pointer_id is used to identify finger in multi touch. each finger is sent in a separate call to ReportTouchInput(), and the callee is responsible for assembling the fingers as needed

Added: 12

TouchScreenSimulateMultiFingerGestureRequest

Defined in fuchsia.ui.test.input/touch.fidl

OrdinalFieldTypeDescription
start_locations [10]

Starting locations of the gesture, in the coordinate units specified during registration.

end_locations [10]

End locations of the gesture, in the coordinate units specified during registration.

move_event_count uint32

Number of move events in the pinch.

finger_count uint32

Number of fingers, because array<fuchsia.math.Vec, MAX_FINGERS> is fixed length, we use this field to know how many fingers in gesture.

Added: 18

TouchScreenSimulateMultiTapRequest

Defined in fuchsia.ui.test.input/touch.fidl

OrdinalFieldTypeDescription
tap_locations vector<fuchsia.math/Vec>[10]

Locations of the tap event, in the coordinate units specified during registration.

TouchScreenSimulateSwipeRequest

Defined in fuchsia.ui.test.input/touch.fidl

OrdinalFieldTypeDescription
start_location fuchsia.math/Vec

Starting location of the swipe, in the coordinate units specified during registration.

end_location fuchsia.math/Vec

End location of the swipe, in the coordinate units specified during registration.

move_event_count uint32

Number of move events in the swipe.

TouchScreenSimulateTapRequest

Defined in fuchsia.ui.test.input/touch.fidl

OrdinalFieldTypeDescription
tap_location fuchsia.math/Vec

Location of the tap event, in the coordinate units specified during registration.

CONSTANTS

NameValueTypeDescription
MAX_FINGERS 10 uint8
Added: 12
MOUSE_MAX_NUM_BUTTONS 32 uint32

A hardcoded number of max mouse buttons. This should be increased in the future if we ever see mice with more buttons.