| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=HEAD) |
| library fuchsia.input.injection; |
| |
| using fuchsia.input.report; |
| |
| /// A TEST-ONLY protocol which injects `InputDevice`s into the |
| /// input system. |
| /// |
| /// This protocol is not intended for production use; products |
| /// _should_ take measures to ensure this protocol is not |
| /// routed to production components. |
| @discoverable(server="platform") |
| closed protocol InputDeviceRegistry { |
| /// Registers an input device represented by `device`. |
| /// On registration, the InputDeviceRegistry starts listening for input reports on the |
| /// InputReportsReader returned by device.GetInputReportsReader(). |
| strict Register(resource struct { |
| device client_end:fuchsia.input.report.InputDevice; |
| }); |
| |
| /// Registers an input device represented by `device` and return the device id of the |
| /// added test device. |
| /// On registration, the InputDeviceRegistry starts listening for input reports on the |
| /// InputReportsReader returned by device.GetInputReportsReader(). |
| strict RegisterAndGetDeviceInfo(resource struct { |
| device client_end:fuchsia.input.report.InputDevice; |
| }) -> (resource table { |
| 1: device_id uint32; |
| }); |
| }; |