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.
Request
Name | Type |
---|---|
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
Name | Type |
---|---|
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.
Request
<EMPTY>
Response
<EMPTY>
ReportTextInput
Notify the listener of the text string generated by the set of key events received by the application.
Request
Name | Type |
---|---|
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.
Request
Name | Type |
---|---|
payload |
MediaButtonsDeviceSendButtonsStateRequest
|
Response
<EMPTY>
SimulateButtonPress
Simulates a button press and release on the requested button on the device.
Request
Name | Type |
---|---|
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
Name | Type |
---|---|
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
Name | Type |
---|---|
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
Name | Type |
---|---|
payload |
RegistryRegisterKeyboardRequest
|
Response
<EMPTY>
RegisterKeyboardAndGetDeviceInfo
Enables the client to inject keyboard events using the corresponding
client end to device
. Returns device_id of the created 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
Name | Type |
---|---|
payload |
RegistryRegisterKeyboardAndGetDeviceInfoRequest
|
Response
Name | Type |
---|---|
payload |
RegistryRegisterKeyboardAndGetDeviceInfoResponse
|
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
Name | Type |
---|---|
payload |
RegistryRegisterMediaButtonsDeviceRequest
|
Response
<EMPTY>
RegisterMediaButtonsDeviceAndGetDeviceInfo
Enables the client to inject media buttons events using the
corresponding client end to device
. Returns device_id of the created 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
Name | Type |
---|---|
payload |
RegistryRegisterMediaButtonsDeviceAndGetDeviceInfoRequest
|
Response
Name | Type |
---|---|
payload |
RegistryRegisterMediaButtonsDeviceAndGetDeviceInfoResponse
|
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
Name | Type |
---|---|
payload |
RegistryRegisterMouseRequest
|
Response
<EMPTY>
RegisterMouseAndGetDeviceInfo
Enables the client to inject mouse events using the corresponding
client end to device
. Returns device_id of the created 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
Name | Type |
---|---|
payload |
RegistryRegisterMouseAndGetDeviceInfoRequest
|
Response
Name | Type |
---|---|
payload |
RegistryRegisterMouseAndGetDeviceInfoResponse
|
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
Name | Type |
---|---|
payload |
RegistryRegisterTouchScreenRequest
|
Response
<EMPTY>
RegisterTouchScreenAndGetDeviceInfo
Enables the client to inject touch events using the corresponding
client end to device
. Returns device_id of the created 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
Name | Type |
---|---|
payload |
RegistryRegisterTouchScreenAndGetDeviceInfoRequest
|
Response
Name | Type |
---|---|
payload |
RegistryRegisterTouchScreenAndGetDeviceInfoResponse
|
TestAppStatusListener
Defined in fuchsia.ui.test.input/test_app.fidl
Test suites depend on test app status can listen to this listener.
ReportStatus
Notify that the test app is ready to receive input events.
Test app authors should call this method when they are ready to process input events.
Test suites should wait for this call before injecting input events.
Request
Name | Type |
---|---|
status |
TestAppStatus
|
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
Name | Type |
---|---|
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.
Request
Name | Type |
---|---|
payload |
TouchScreenSimulateMultiFingerGestureRequest
|
Response
<EMPTY>
SimulateMultiTap
Simulates multi finger tap at the requested locations.
Request
Name | Type |
---|---|
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
Name | Type |
---|---|
payload |
TouchScreenSimulateSwipeRequest
|
Response
<EMPTY>
SimulateTap
Simulates a tap at the requested location.
Request
Name | Type |
---|---|
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.
Request
Name | Type |
---|---|
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).
Name | Value | Description |
---|---|---|
DEFAULT |
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. |
PHYSICAL_PIXELS |
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 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.
Name | Value | Description |
---|---|---|
FIRST |
0 |
"Left" mouse button. |
SECOND |
1 |
"Right" mouse button. |
THIRD |
2 |
"Third" mouse button. |
MouseEventPhase flexible
Type: uint32
Defined in fuchsia.ui.test.input/mouse.fidl
Identifies the phase of a mouse event.
Name | Value | Description |
---|---|---|
ADD |
0 |
The observer has started tracking the mouse. |
HOVER |
1 |
The mouse has moved since the last ADD event, without an interceding DOWN event. |
DOWN |
2 |
One or more mouse buttons have been pressed. |
MOVE |
3 |
The mouse has moved since the last DOWN event. |
UP |
4 |
All pressed buttons have been released. |
WHEEL |
5 |
The mouse wheel was manipulated. |
TestAppStatus flexible
Type: uint16
Defined in fuchsia.ui.test.input/test_app.fidl
Name | Value | Description |
---|---|---|
HANDLERS_REGISTERED |
1 |
Must of input tests (mouse / touch) only require HANDLERS_REGISTERED. HANDLERS_REGISTERED means test app has started and event handlers are registered. |
ELEMENT_FOCUSED |
2 |
Keyboard related tests may require ELEMENT_FOCUSED status before inject key events. For example Chromium related tests, event handler is registered to a |
TABLES
KeyboardInputListenerReportTextInputRequest
Defined in fuchsia.ui.test.input/text.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
text |
string:1024
|
The content of the text input received by the reporter. |
2 |
non_printable |
fuchsia.ui.input3/NonPrintableKey
|
The non printable key received by the reporter. Added: 18
|
3 |
device_id |
uint32
|
Added: 24
|
KeyboardSimulateKeyEventRequest
Defined in fuchsia.ui.test.input/text.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
report |
fuchsia.input.report/KeyboardInputReport
|
KeyboardSimulateUsAsciiTextEntryRequest
Defined in fuchsia.ui.test.input/text.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
text |
string:1024
|
MediaButtonsDeviceSendButtonsStateRequest
Defined in fuchsia.ui.test.input/media_buttons.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
buttons |
vector<fuchsia.input.report/ConsumerControlButton>:255
|
The button receiving the button press. |
MediaButtonsDeviceSimulateButtonPressRequest
Defined in fuchsia.ui.test.input/media_buttons.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
button |
fuchsia.input.report/ConsumerControlButton
|
The button receiving the button press. |
MouseInputListenerReportMouseInputRequest
Defined in fuchsia.ui.test.input/mouse.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
local_x |
float64
|
The horizontal coordinate in the reporter's coordinate system. |
2 |
local_y |
float64
|
The vertical coordinate in the reporter's coordinate system. |
3 |
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. |
4 |
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. |
5 |
buttons |
vector<MouseButton>:32
|
The pressed buttons that the reporter received. |
6 |
phase |
MouseEventPhase
|
The phase of the mouse event that the reporter received. |
7 |
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. |
8 |
wheel_x_physical_pixel |
float64
|
The horizontal wheel scroll delta in physical pixels. |
9 |
wheel_y_physical_pixel |
float64
|
The vertical wheel scroll delta in physical pixels. |
10 |
device_id |
uint32
|
Added: 24
|
MouseSimulateMouseEventRequest
Defined in fuchsia.ui.test.input/mouse.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
pressed_buttons |
vector<MouseButton>:32
|
Set of buttons that are currently pressed. Must NOT contain duplicates. |
2 |
movement_x |
int64
|
Relative X positional displacement. |
3 |
movement_y |
int64
|
Relative Y positional displacement. |
4 |
scroll_v_detent |
int64
|
Relative vertical scrolling displacement by detent. |
5 |
scroll_h_detent |
int64
|
Relative horizontal scrolling displacement by detent. |
6 |
scroll_v_physical_pixel |
float64
|
Recommended vertical scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc. |
7 |
scroll_h_physical_pixel |
float64
|
Recommended horizontal scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc. |
RegistryRegisterKeyboardAndGetDeviceInfoRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:Keyboard
|
RegistryRegisterKeyboardAndGetDeviceInfoResponse resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device_id |
uint32
|
RegistryRegisterKeyboardRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:Keyboard
|
RegistryRegisterMediaButtonsDeviceAndGetDeviceInfoRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:MediaButtonsDevice
|
RegistryRegisterMediaButtonsDeviceAndGetDeviceInfoResponse resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device_id |
uint32
|
RegistryRegisterMediaButtonsDeviceRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:MediaButtonsDevice
|
RegistryRegisterMouseAndGetDeviceInfoRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:Mouse
|
RegistryRegisterMouseAndGetDeviceInfoResponse resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device_id |
uint32
|
RegistryRegisterMouseRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:Mouse
|
RegistryRegisterTouchScreenAndGetDeviceInfoRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:TouchScreen
|
|
2 |
coordinate_unit |
CoordinateUnit
|
Indicates the coordinate space in which to describe touch events. |
RegistryRegisterTouchScreenAndGetDeviceInfoResponse resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device_id |
uint32
|
RegistryRegisterTouchScreenRequest resource
Defined in fuchsia.ui.test.input/registry.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
server_end:TouchScreen
|
|
2 |
coordinate_unit |
CoordinateUnit
|
Indicates the coordinate space in which to describe touch events. Added: 11
|
TouchInputListenerReportTouchInputRequest
Defined in fuchsia.ui.test.input/touch.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
local_x |
float64
|
The horizontal coordinate, in the reporter's coordinate system. |
2 |
local_y |
float64
|
The vertical coordinate, in the reporter's coordinate system. |
3 |
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. |
4 |
device_pixel_ratio |
float64
|
The number of physical pixels, per logical pixel, as reported by the reporter. |
5 |
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. |
6 |
phase |
fuchsia.ui.pointer/EventPhase
|
The phase of the touch event. Added: 12
|
7 |
pointer_id |
uint32
|
pointer_id is used to identify finger in multi touch. each finger
is sent in a separate call to Added: 12
|
8 |
device_id |
uint32
|
Added: 24
|
TouchScreenSimulateMultiFingerGestureRequest
Defined in fuchsia.ui.test.input/touch.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
start_locations |
array<fuchsia.math/Vec, 10>
|
Starting locations of the gesture, in the coordinate units specified during registration. |
2 |
end_locations |
array<fuchsia.math/Vec, 10>
|
End locations of the gesture, in the coordinate units specified during registration. |
3 |
move_event_count |
uint32
|
Number of move events in the pinch. |
4 |
finger_count |
uint32
|
Number of fingers, because Added: 18
|
TouchScreenSimulateMultiTapRequest
Defined in fuchsia.ui.test.input/touch.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
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
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
start_location |
fuchsia.math/Vec
|
Starting location of the swipe, in the coordinate units specified during registration. |
2 |
end_location |
fuchsia.math/Vec
|
End location of the swipe, in the coordinate units specified during registration. |
3 |
move_event_count |
uint32
|
Number of move events in the swipe. |
TouchScreenSimulateTapRequest
Defined in fuchsia.ui.test.input/touch.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
tap_location |
fuchsia.math/Vec
|
Location of the tap event, in the coordinate units specified during registration. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
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. |