协议
InputDevice
在 fuchsia.input.report/device.fidl 中定义
InputDevice 驱动程序表示单个物理输入设备。InputDevice 为连接的每个客户端维护一个包含 MAX_DEVICE_REPORT_COUNT 报告的内部 FIFO。客户端读取报告后,系统会将其从 FIFO 中移除。如果 FIFO 已满,它会丢弃最早的报告,以便为传入报告腾出空间。
GetDescriptor
获取此设备的设备描述符。
请求
<EMPTY>
响应
| 名称 | 类型 | 
|---|---|
descriptor | 
            
                DeviceDescriptor
             | 
        
GetFeatureReport
获取指定设备的功能报告。用于请求设备功能的状态。
请求
<EMPTY>
响应
| 名称 | 类型 | 
|---|---|
payload | 
            
                InputDevice_GetFeatureReport_Result
             | 
        
GetInputReport
一般情况下,InputReportReader 是获取 InputReports 的首选方式。对于自然不会发送 InputReports 的设备,此方法可用于从指定的设备类型请求报告。不会阻塞;如果 GetInputReport 或 device_type 不受支持,则返回 ZX_ERR_NOT_SUPPORTED。
请求
| 名称 | 类型 | 
|---|---|
device_type | 
            
                DeviceType
             | 
        
响应
| 名称 | 类型 | 
|---|---|
payload | 
            
                InputDevice_GetInputReport_Result
             | 
        
GetInputReportsReader
在此设备上打开新的 InputReportsReader。每个读者都会收到自己的报告。
请求
| 名称 | 类型 | 
|---|---|
reader | 
            
                server_end<InputReportsReader>
             | 
        
SendOutputReport
向设备发送一份输出报告。如果输出报告未跟随 OutputDescriptor,则会抛出错误。
请求
| 名称 | 类型 | 
|---|---|
report | 
            
                OutputReport
             | 
        
响应
| 名称 | 类型 | 
|---|---|
payload | 
            
                InputDevice_SendOutputReport_Result
             | 
        
SetFeatureReport
为指定设备设置功能报告。此设置用于设置设备功能的状态。
请求
| 名称 | 类型 | 
|---|---|
report | 
            
                FeatureReport
             | 
        
响应
| 名称 | 类型 | 
|---|---|
payload | 
            
                InputDevice_SetFeatureReport_Result
             | 
        
InputReportsReader
在 fuchsia.input.report/device.fidl 中定义
每个 InputReportsReader 都有自己维护的 InputReports FIFO。当调用 ReadInputReports 时,它会排空 InputReports FIFO。如果在排空 FIFO 之前创建了过多的 InputReports,则最旧的 InputReport 将被静默地舍弃。
ReadInputReports
这是一个 Hanging-Get 函数,用于读取 InputReport FIFO 中的报告。除非有至少一个报告,否则系统不会回复。 如果已有待处理的 Hanging-Get,再次调用它将返回 ZX_ERR_ALREADY_BOUND。
请求
<EMPTY>
响应
| 名称 | 类型 | 
|---|---|
payload | 
            
                InputReportsReader_ReadInputReports_Result
             | 
        
结构体
轴
在 fuchsia.input.report/units.fidl 中定义
Axis 定义为 range 和 unit。
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
range | 
            
                Range
             | 
            无默认设置 | |
unit | 
            
                Unit
             | 
            无默认设置 | 
DeviceInfo
在 fuchsia.input.report/descriptor.fidl 中定义
DeviceInfo 提供有关设备的更多信息,可让客户端区分设备(例如,来自不同供应商的两个触摸屏)。如果设备是 HID 设备,则 ID 信息将来自设备本身。其他非 HID 设备可能会在驱动程序中分配 ID,因此驱动程序作者需要分配合理的 ID。
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
vendor_id | 
            
                uint32
             | 
            无默认设置 | |
product_id | 
            
                uint32
             | 
            无默认设置 | |
version | 
            
                uint32
             | 
            无默认设置 | 
InputDevice_GetFeatureReport_Response
在 fuchsia.input.report/device.fidl 中定义
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
report | 
            
                FeatureReport
             | 
            无默认设置 | 
InputDevice_GetInputReport_Response
在 fuchsia.input.report/device.fidl 中定义
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
report | 
            
                InputReport
             | 
            无默认设置 | 
InputDevice_SendOutputReport_Response
在 fuchsia.input.report/device.fidl 中定义
<EMPTY>
InputDevice_SetFeatureReport_Response
在 fuchsia.input.report/device.fidl 中定义
<EMPTY>
InputReportsReader_ReadInputReports_Response
在 fuchsia.input.report/device.fidl 中定义
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
reports | 
            
                vector<InputReport>[50]
             | 
            无默认设置 | 
范围
在 fuchsia.input.report/units.fidl 中定义
描述值的 Range。
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
min | 
            
                int64
             | 
            无默认设置 | |
max | 
            
                int64
             | 
            无默认设置 | 
SensorAxis
在 fuchsia.input.report/sensor.fidl 中定义
SensorAxis 是普通的 Axis,并带有一个额外的 SensorType 来描述轴测量的内容。
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
axis | 
            
                Axis
             | 
            无默认设置 | |
type | 
            
                SensorType
             | 
            无默认设置 | 
单位
在 fuchsia.input.report/units.fidl 中定义
通过给定单位和单位的指数来描述给定单位。 例如:纳米计的类型应为 METERS,指数为 -9。
| 字段 | 类型 | 说明 | 默认 | 
|---|---|---|---|
type | 
            
                UnitType
             | 
            无默认设置 | |
exponent | 
            
                int32
             | 
            无默认设置 | 
精英
ConsumerControlButton 柔性
类型:uint32
在 fuchsia.input.report/consumer_control.fidl 中定义
这些 ControlButton 代表用于更改主机配置的开启/关闭按钮。
| 名称 | 值 | 说明 | 
|---|---|---|
VOLUME_UP | 
            1 | 
            此按钮表示调高音量。  | 
        
VOLUME_DOWN | 
            2 | 
            此按钮表示调低音量。  | 
        
暂停 | 
            3 | 
            此按钮表示暂停。  | 
        
FACTORY_RESET | 
            4 | 
            此按钮表示将主机恢复出厂设置。  | 
        
MIC_MUTE | 
            5 | 
            此按钮表示将主机上的麦克风静音。  | 
        
重新启动 | 
            6 | 
            此按钮表示重新启动主机。  | 
        
CAMERA_DISABLE | 
            7 | 
            此按钮表示停用主机上的摄像头。  | 
        
FUNCTION | 
            8 | 
            此按钮表示函数。 添加时间:HEAD 
 | 
        
POWER | 
            9 | 
            此按钮代表电源按钮。 添加时间:HEAD 
 | 
        
DeviceType 柔性环境
类型:uint32
在 fuchsia.input.report/device.fidl 中定义
由 InputDevice.GetInputReport 填充的 InputReport 字段。
| 名称 | 值 | 说明 | 
|---|---|---|
MOUSE | 
            0 | 
            |
传感器 | 
            1 | 
            |
TOUCH | 
            2 | 
            |
键盘 | 
            3 | 
            |
CONSUMER_CONTROL | 
            4 | 
            
LedType 柔性
类型:uint32
在 fuchsia.input.report/led.fidl 中定义
LedType 表示设备上可以开启或关闭的 LED 灯。在适用情况下,每个 LED 灯的定义均根据以下来源之一得出(尽管具有 Fuchsia 特有的数值):
- 用途页 0x0008 (LED) 的 USB HID 用途代码
 
| 名称 | 值 | 说明 | 
|---|---|---|
NUM_LOCK | 
            1 | 
            用于指示键盘的数字锁定功能的 LED 指示灯。 对应于 USB HID 页面 0x0008 用途 0x0001  | 
        
CAPS_LOCK | 
            2 | 
            用于指示键盘的大写锁定已启用的 LED 灯。 对应于 USB HID 页面 0x0008 用途 0x0002  | 
        
SCROLL_LOCK | 
            3 | 
            用于指示键盘的滚动锁定已启用的 LED 灯。 对应于 USB HID 页面 0x0008 用途 0x0003  | 
        
撰写 | 
            4 | 
            用于指示键盘合成模式已启用的 LED 灯。 对应于 USB HID 页面 0x0008 用法 0x0004  | 
        
假名 | 
            5 | 
            用于指示键盘的假名模式已启用的 LED 灯。 对应于 USB HID 页面 0x0008 用法 0x0005  | 
        
传感器 ReportingState 柔性环境
类型:uint32
在 fuchsia.input.report/sensor.fidl 中定义
SensorReportingState 用于确定传感器何时发送报告。
| 名称 | 值 | 说明 | 
|---|---|---|
REPORT_NO_EVENTS | 
            1 | 
            此传感器不会发送任何事件。  | 
        
REPORT_ALL_EVENTS | 
            2 | 
            所有事件都将从传感器发送。对于大多数传感器,此频率可以通过   | 
        
REPORT_THRESHOLD_EVENTS | 
            3 | 
            系统只会报告超出阈值的事件。  | 
        
传感器类型 flexible
类型:uint32
在 fuchsia.input.report/sensor.fidl 中定义
每个传感器值都有对应的 SensorType,用于解释该值在现实世界中测量的内容。
| 名称 | 值 | 说明 | 
|---|---|---|
ACCELEROMETER_X | 
            1 | 
            X 轴上的加速度。  | 
        
ACCELEROMETER_Y | 
            2 | 
            Y 轴上的加速度。  | 
        
ACCELEROMETER_Z | 
            3 | 
            Z 轴上的加速度。  | 
        
MAGNETOMETER_X | 
            4 | 
            X 轴的磁场强度。  | 
        
MAGNETOMETER_Y | 
            5 | 
            Y 轴的磁场强度。  | 
        
MAGNETOMETER_Z | 
            6 | 
            Z 轴的磁场强度。  | 
        
GYROSCOPE_X | 
            7 | 
            X 方向上逆时针移动的角速度。  | 
        
GYROSCOPE_Y | 
            8 | 
            Y 方向上逆时针移动的角速度。  | 
        
GYROSCOPE_Z | 
            9 | 
            Z 方向上逆时针移动的角速度。  | 
        
LIGHT_ILLUMINANCE | 
            10 | 
            光的环境级别。  | 
        
LIGHT_RED | 
            11 | 
            红灯的环境级别。  | 
        
LIGHT_GREEN | 
            12 | 
            绿灯的环境级别。  | 
        
LIGHT_BLUE | 
            13 | 
            蓝光的环境级别。  | 
        
TouchConfigurationInputMode flexible
类型:uint32
在 fuchsia.input.report/touch.fidl 中定义
输入模式,指示应将哪个顶级集合用于输入报告。这些值必须对应于《通用串行总线 (USB) HID 用法表》(https://usb.org/sites/default/files/hut1_22.pdf) 第 16.7 节中定义的输入模式。
| 名称 | 值 | 说明 | 
|---|---|---|
MOUSE_COLLECTION | 
            0 | 
            使用鼠标集合报告数据。  | 
        
WINDOWS_PRECISION_TOUCHPAD_COLLECTION | 
            3 | 
            使用 Windows Precision Touchpad Collection 获取报告数据。由 Windows Precision Touchpad 所需的 HID 顶级集合定义:https://docs.microsoft.com/zh-cn/windows-hardware/design/component-guidelines/windows-transparency-touchpad-required -hid-top-level-collections)。  | 
        
TouchType 柔性
类型:uint32
在 fuchsia.input.report/touch.fidl 中定义
发起触摸的设备类型。
| 名称 | 值 | 说明 | 
|---|---|---|
触摸屏 | 
            1 | 
            触摸屏具有与显示屏相关联的直接手指输入。  | 
        
触控板 | 
            2 | 
            触摸板是一种指控设备,用于跟踪手指位置。  | 
        
UnitType 柔性
类型:uint32
在 fuchsia.input.report/units.fidl 中定义
这是一种指定单位的简单标准化方法。您可以根据需要添加新单位。每种 UnitType 都应该以特定单位命名,并且可以通过名称完全区分这些单位(例如,使用 METERS,而不是 DISTANCE)。需要区分的更复杂的单位应以 SI_(表示国际单位制)或 ENGLISH_(表示英语单位制)开头。
| 名称 | 值 | 说明 | 
|---|---|---|
无 | 
            0 | 
            设备未指定单位。  | 
        
其他 | 
            1 | 
            设备指定的单位,无法转换为任何其他单位。  | 
        
米 | 
            2 | 
            测量距离(以米为单位)。  | 
        
GRAM | 
            3 | 
            以克为单位测量的质量。  | 
        
学位 | 
            4 | 
            旋转角度,以度为单位。  | 
        
ENGLISH_ANGULAR_VELOCITY | 
            5 | 
            角速度的测量值,以每秒度数为单位。  | 
        
SI_LINEAR_VELOCITY | 
            6 | 
            测量线性速度,以米/秒为单位。  | 
        
SI_LINEAR_ACCELERATION | 
            7 | 
            加速度的测量值,以米/秒平方为单位。  | 
        
韦伯 | 
            8 | 
            Weber 中磁通量的度量。  | 
        
蜡烛 | 
            9 | 
            烛光亮度测量。  | 
        
帕斯卡尔 | 
            10 | 
            压力测量,以帕斯卡为单位。  | 
        
奢华 | 
            11 | 
            |
秒 | 
            12 | 
            
VendorGoogleProductId 柔性环境
类型:uint32
在 fuchsia.input.report/device_ids.fidl 中定义
下面是 ProductId,表示此输入设备所代表的产品。如果输入设备是 HID 设备,ProductId 会直接映射到 HID ProductId。如果输入设备不是 HID 设备,则 ProductId 将大于 0xFFFF,这是最大 HID ProductId。
| 名称 | 值 | 说明 | 
|---|---|---|
FOCALTECH_TOUCHSCREEN | 
            65537 | 
            以下是非 HID 供应商 ID  | 
        
AMS_LIGHT_SENSOR | 
            65538 | 
            |
PC_PS2_KEYBOARD | 
            65539 | 
            |
PC_PS2_MOUSE | 
            65540 | 
            |
ADC_BUTTONS | 
            65541 | 
            添加时间:HEAD 
 | 
        
GOODIX_TOUCHSCREEN | 
            65542 | 
            添加时间:HEAD 
 | 
        
HID_BUTTONS | 
            65543 | 
            添加时间:HEAD 
 | 
        
VIRTIO_MOUSE | 
            65544 | 
            添加时间:HEAD 
 | 
        
VIRTIO_KEYBOARD | 
            65545 | 
            添加时间:HEAD 
 | 
        
VIRTIO_TOUCHSCREEN | 
            65546 | 
            添加时间:HEAD 
 | 
        
GOLDFISH_ACCELERATION_SENSOR | 
            2417819649 | 
            |
GOLDFISH_GYROSCOPE_SENSOR | 
            2417819650 | 
            |
GOLDFISH_RGBC_LIGHT_SENSOR | 
            2417819651 | 
            
VendorId 柔性环境
类型:uint32
在 fuchsia.input.report/device_ids.fidl 中定义
VendorId 表示创建此输入设备的供应商。如果输入设备是 HID 设备,则 VendorId 会直接映射到 HID VendorId。如果输入设备不是 HID 设备,则 VendorId 将大于 0xFFFF,这是最大 HID VendorId。
| 名称 | 值 | 说明 | 
|---|---|---|
6353 | 
            以下是 HID 供应商 ID,范围为 0x0000 - 0xFFFF。  | 
        
表
ConsumerControlDescriptor
在 fuchsia.input.report/consumer_control.fidl 中定义
Fuchsia ConsumerControl 表示旨在更改主机上的值的设备。典型的控件包括音量、电源、媒体播放。(假设电视遥控器是典型的 ConsumerControl)。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input | 
            
                ConsumerControlInputDescriptor
             | 
            
ConsumerControlInputDescriptor
在 fuchsia.input.report/consumer_control.fidl 中定义
描述从 ConsumerControl 设备发送到主机的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            buttons | 
            
                vector<ConsumerControlButton>[255]
             | 
            此设备包含的按钮列表。  | 
        
ConsumerControlInputReport
在 fuchsia.input.report/consumer_control.fidl 中定义
由 ConsumerControl 设备创建的单个报告。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            pressed_buttons | 
            
                vector<ConsumerControlButton>[255]
             | 
            当前按下的按钮列表。  | 
        
ContactInputDescriptor
在 fuchsia.input.report/touch.fidl 中定义
ContactInputDescriptor 描述与触摸设备上的触摸相关联的字段。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            position_x | 
            
                Axis
             | 
            描述报告 x 轴。  | 
        
2 | 
            position_y | 
            
                Axis
             | 
            描述 y 轴的报告。  | 
        
3 | 
            pressure | 
            
                Axis
             | 
            接触的压力。  | 
        
4 | 
            contact_width | 
            
                Axis
             | 
            接触区域的宽度。  | 
        
5 | 
            contact_height | 
            
                Axis
             | 
            接触区域的高度。  | 
        
ContactInputReport
在 fuchsia.input.report/touch.fidl 中定义
ContactInputReport 描述触摸设备上的一次触摸。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            contact_id | 
            
                uint32
             | 
            此联系人的标识符。  | 
        
2 | 
            position_x | 
            
                int64
             | 
            联系人在 x 轴上的位置。  | 
        
3 | 
            position_y | 
            
                int64
             | 
            联系人在 y 轴上的位置。  | 
        
4 | 
            pressure | 
            
                int64
             | 
            接触的压力。  | 
        
5 | 
            contact_width | 
            
                int64
             | 
            触摸接触点周围的边界框的宽度。与   | 
        
6 | 
            contact_height | 
            
                int64
             | 
            触摸接触点周围的边界框的高度。与   | 
        
7 | 
            confidence | 
            
                bool
             | 
            也称为“轻触有效”。表示设备对于相应触摸接触是否为预期的有效接触的置信度。如果接触点无效,设备应报告 0。如果联系是预期且有效的(例如,指控触摸),设备应报告 1 添加时间:9 
 | 
        
DeviceDescriptor
在 fuchsia.input.report/descriptor.fidl 中定义
DeviceDescriptor 描述物理输入设备。某些实体设备可能会发送多种类型的报告(例如,实体触摸屏可以发送触摸和触控笔报告,因此它会同时拥有 TouchDescriptor 和 StylusDescriptor)。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            device_info | 
            
                DeviceInfo
             | 
            此字段已移除。请改用 device_information。 移除:20 
 | 
        
2 | 
            mouse | 
            
                MouseDescriptor
             | 
            当   | 
        
3 | 
            sensor | 
            
                SensorDescriptor
             | 
            当   | 
        
4 | 
            touch | 
            
                TouchDescriptor
             | 
            当   | 
        
5 | 
            keyboard | 
            
                KeyboardDescriptor
             | 
            当   | 
        
6 | 
            consumer_control | 
            
                ConsumerControlDescriptor
             | 
            当存在   | 
        
7 | 
            device_information | 
            
                DeviceInformation
             | 
            
 添加时间:20 
 | 
        
DeviceInformation
在 fuchsia.input.report/descriptor.fidl 中定义
DeviceInformation 提供有关设备的更多信息,并允许客户端区分设备(例如,不同供应商提供的两个触摸屏)。如果设备是 HID 设备,则 ID 信息将来自设备本身。其他非 HID 设备可能会在驱动程序中分配 ID,因此驱动程序作者需负责分配合理的 ID。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            vendor_id | 
            
                uint32
             | 
            |
2 | 
            product_id | 
            
                uint32
             | 
            |
3 | 
            version | 
            
                uint32
             | 
            |
4 | 
            polling_rate | 
            
                zx/Duration
             | 
            
FeatureReport
在 fuchsia.input.report/report.fidl 中定义
包含输入设备的功能信息的单个报告。 从设备获取的功能报告会显示设备的当前状态。向设备发送功能报告会将设备设置为该状态。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            sensor | 
            
                SensorFeatureReport
             | 
            |
2 | 
            touch | 
            
                TouchFeatureReport
             | 
            
InputReport
在 fuchsia.input.report/report.fidl 中定义
InputReport 是由输入设备创建的单个报告。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            event_time | 
            
                zx/Time
             | 
            
  | 
        
2 | 
            mouse | 
            
                MouseInputReport
             | 
            
  | 
        
3 | 
            trace_id | 
            
                uint64
             | 
            用于连接跟踪记录异步开始/结束事件的唯一 ID。  | 
        
4 | 
            sensor | 
            
                SensorInputReport
             | 
            
  | 
        
5 | 
            touch | 
            
                TouchInputReport
             | 
            
  | 
        
6 | 
            keyboard | 
            
                KeyboardInputReport
             | 
            
  | 
        
7 | 
            consumer_control | 
            
                ConsumerControlInputReport
             | 
            
  | 
        
8 | 
            report_id | 
            
                uint8
             | 
            描述此 InputReport 的描述符将具有一个匹配的 ReportID。如果不存在,则 report_id 为 0。  | 
        
KeyboardDescriptor
在 fuchsia.input.report/keyboard.fidl 中定义
键盘设备的功能。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input | 
            
                KeyboardInputDescriptor
             | 
            |
2 | 
            output | 
            
                KeyboardOutputDescriptor
             | 
            
KeyboardInputDescriptor
在 fuchsia.input.report/keyboard.fidl 中定义
说明从键盘发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
2 | 
            keys3 | 
            
                vector<fuchsia.input/Key>[256]
             | 
            此键盘包含的按键的列表。  | 
        
KeyboardInputReport
在 fuchsia.input.report/keyboard.fidl 中定义
通过键盘设备创建的单个报告。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
2 | 
            pressed_keys3 | 
            
                vector<fuchsia.input/Key>[256]
             | 
            当前按下的键的列表。  | 
        
KeyboardOutputDescriptor
在 fuchsia.input.report/keyboard.fidl 中定义
说明可发送到键盘的输出报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            leds | 
            
                vector<LedType>[256]
             | 
            可切换的键盘 LED 指示灯列表。  | 
        
KeyboardOutputReport
在 fuchsia.input.report/keyboard.fidl 中定义
包含键盘输出信息的单个报告。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            enabled_leds | 
            
                vector<LedType>[256]
             | 
            此列表中的每个 LED 灯都将亮起。此列表中没有的所有 LED 指示灯都将关闭。  | 
        
MouseDescriptor
在 fuchsia.input.report/mouse.fidl 中定义
鼠标设备的功能。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input | 
            
                MouseInputDescriptor
             | 
            
MouseInputDescriptor
在 fuchsia.input.report/mouse.fidl 中定义
说明从鼠标发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            movement_x | 
            
                Axis
             | 
            X 轴相对移动的范围。  | 
        
2 | 
            movement_y | 
            
                Axis
             | 
            Y 轴相对移动的范围。  | 
        
3 | 
            scroll_v | 
            
                Axis
             | 
            相对垂直滚动的范围。  | 
        
4 | 
            scroll_h | 
            
                Axis
             | 
            相对水平滚动的范围。  | 
        
5 | 
            buttons | 
            
                vector<uint8>[32]
             | 
            这是鼠标按钮的 ID 矢量。  | 
        
6 | 
            position_x | 
            
                Axis
             | 
            X 的位置范围。 位置的主要用途是借助 VNC 等虚拟鼠标。  | 
        
7 | 
            position_y | 
            
                Axis
             | 
            Y 位置的范围。 位置的主要用途是借助 VNC 等虚拟鼠标。  | 
        
MouseInputReport
在 fuchsia.input.report/mouse.fidl 中定义
MouseReport 提供了鼠标和当前按下的按钮的相对移动。“相对”表示在上一个报告和此报告之间发生的移动。客户端负责对其进行跟踪,并将其转换为绝对移动。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            movement_x | 
            
                int64
             | 
            相对 X 位置位移。  | 
        
2 | 
            movement_y | 
            
                int64
             | 
            相对 Y 位置位移。  | 
        
3 | 
            scroll_v | 
            
                int64
             | 
            相对垂直滚动位移。  | 
        
4 | 
            scroll_h | 
            
                int64
             | 
            相对水平滚动位移。  | 
        
5 | 
            pressed_buttons | 
            
                vector<uint8>[32]
             | 
            当前按下的按钮的列表。  | 
        
6 | 
            position_x | 
            
                int64
             | 
            X 的位置。 位置的主要用途是借助 VNC 等虚拟鼠标。  | 
        
7 | 
            position_y | 
            
                int64
             | 
            Y 的位置。 位置的主要用途是借助 VNC 等虚拟鼠标。  | 
        
OutputDescriptor
在 fuchsia.input.report/descriptor.fidl 中定义
描述物理输入设备将接受的输出报告。 输出信息通常表示设备对用户的输出信息(例如 LED、触觉反馈等)。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            keyboard | 
            
                KeyboardOutputDescriptor
             | 
            
OutputReport
在 fuchsia.input.report/report.fidl 中定义
包含输入设备输出信息的单个报告。 输出信息通常表示设备对用户的输出信息(例如 LED、触觉反馈等)。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            keyboard | 
            
                KeyboardOutputReport
             | 
            
SelectiveReportingFeatureReport
在 fuchsia.input.report/touch.fidl 中定义
选择性报告功能报告,指示要报告哪些类型的输入。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            surface_switch | 
            
                bool
             | 
            如果为 true,设备会报告 Surface 联系人。  | 
        
2 | 
            button_switch | 
            
                bool
             | 
            如果值为 true,设备将报告按钮状态。  | 
        
SensorDescriptor
在 fuchsia.input.report/sensor.fidl 中定义
传感器设备的功能。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input | 
            
                vector<SensorInputDescriptor>[255]
             | 
            |
2 | 
            feature | 
            
                vector<SensorFeatureDescriptor>[255]
             | 
            
SensorFeatureDescriptor
在 fuchsia.input.report/sensor.fidl 中定义
描述传感器的功能报告的格式。可以从传感器请求功能报告,也可以将功能报告发送到传感器。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            report_interval | 
            
                Axis
             | 
            说明此传感器支持的最小和最大报告间隔。  | 
        
2 | 
            sensitivity | 
            
                vector<SensorAxis>[100]
             | 
            为指定的   | 
        
3 | 
            supports_reporting_state | 
            
                bool
             | 
            如果为 true,则 SensorFeatureReport 支持设置 SensorReportingState。  | 
        
4 | 
            threshold_high | 
            
                vector<SensorAxis>[100]
             | 
            为给定   | 
        
5 | 
            threshold_low | 
            
                vector<SensorAxis>[100]
             | 
            为给定   | 
        
6 | 
            sampling_rate | 
            
                Axis
             | 
            描述此传感器支持的最小和最大采样率。  | 
        
7 | 
            report_id | 
            
                uint8
             | 
            当前描述符的 ReportID。具有相同报告 ID 的报告应与此描述符相关联。  | 
        
SensorFeatureReport
在 fuchsia.input.report/sensor.fidl 中定义
SensorFeatureReport 描述了给定传感器的特征。如果 FeatureReport 发送到输入设备,它会设置设备的配置。如果从输入设备请求 FeatureReport,它会显示设备的当前配置。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            report_interval | 
            
                int64
             | 
            传感器两次发送报告的间隔时间。  | 
        
2 | 
            sensitivity | 
            
                vector<int64>[100]
             | 
            各种   | 
        
3 | 
            reporting_state | 
            
                SensorReportingState
             | 
            这决定了传感器何时发送报告。  | 
        
4 | 
            threshold_high | 
            
                vector<int64>[100]
             | 
            各种   | 
        
5 | 
            threshold_low | 
            
                vector<int64>[100]
             | 
            各种   | 
        
6 | 
            sampling_rate | 
            
                int64
             | 
            传感器的采样速率。  | 
        
SensorInputDescriptor
在 fuchsia.input.report/sensor.fidl 中定义
描述从传感器发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            values | 
            
                vector<SensorAxis>[100]
             | 
            
  | 
        
2 | 
            report_id | 
            
                uint8
             | 
            当前描述符的 ReportID。具有相同报告 ID 的报告应与此描述符相关联。  | 
        
SensorInputReport
在 fuchsia.input.report/sensor.fidl 中定义
SensorReport 表示传感器在给定时间点测量的值。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            values | 
            
                vector<int64>[100]
             | 
            
  | 
        
TouchDescriptor
在 fuchsia.input.report/touch.fidl 中定义
触摸设备的功能。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input | 
            
                TouchInputDescriptor
             | 
            |
2 | 
            feature | 
            
                TouchFeatureDescriptor
             | 
            
TouchFeatureDescriptor
在 fuchsia.input.report/touch.fidl 中定义
描述触控板配置的功能报告的格式。可以通过触控板请求功能报告,也可以将功能报告发送到触控板。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            supports_input_mode | 
            
                bool
             | 
            指示触控功能描述符是否支持不同的输入模式。  | 
        
2 | 
            supports_selective_reporting | 
            
                bool
             | 
            指明触摸功能描述符是否支持选择性报告。  | 
        
TouchFeatureReport
在 fuchsia.input.report/touch.fidl 中定义
TouchFeatureReport 描述给定触摸设备的功能。如果 FeatureReport 发送到输入设备,它会设置设备的配置。如果从输入设备请求 FeatureReport,它会显示设备的当前配置。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            input_mode | 
            
                TouchConfigurationInputMode
             | 
            当前正在报告的输入法。  | 
        
2 | 
            selective_reporting | 
            
                SelectiveReportingFeatureReport
             | 
            当前报告的报告类型。  | 
        
TouchInputDescriptor
在 fuchsia.input.report/touch.fidl 中定义
说明从键盘发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            contacts | 
            
                vector<ContactInputDescriptor>[10]
             | 
            与此触摸描述符关联的联系人描述符。  | 
        
2 | 
            max_contacts | 
            
                uint32
             | 
            此触摸设备一次可报告的联系人数量上限。  | 
        
3 | 
            touch_type | 
            
                TouchType
             | 
            所使用的触摸设备的类型。  | 
        
4 | 
            buttons | 
            
                vector<uint8>[10]
             | 
            触摸设备上实体按钮的标识符。  | 
        
TouchInputReport
在 fuchsia.input.report/touch.fidl 中定义
TouchInputReport 用于描述触摸屏记录的当前联系人。
| 序数 | 字段 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            contacts | 
            
                vector<ContactInputReport>[10]
             | 
            设备目前正在报告的联系人。  | 
        
2 | 
            pressed_buttons | 
            
                vector<uint8>[10]
             | 
            当前按下按钮的标识符。  | 
        
联合体
InputDevice_GetFeatureReport_Result strict
在 fuchsia.input.report/device.fidl 中定义
| 序数 | 变体 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            response | 
            
                InputDevice_GetFeatureReport_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            
InputDevice_GetInputReport_Result strict
在 fuchsia.input.report/device.fidl 中定义
| 序数 | 变体 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            response | 
            
                InputDevice_GetInputReport_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            
InputDevice_SendOutputReport_Result strict
在 fuchsia.input.report/device.fidl 中定义
| 序数 | 变体 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            response | 
            
                InputDevice_SendOutputReport_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            
InputDevice_SetFeatureReport_Result strict
在 fuchsia.input.report/device.fidl 中定义
| 序数 | 变体 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            response | 
            
                InputDevice_SetFeatureReport_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            
InputReportsReader_ReadInputReports_Result strict
在 fuchsia.input.report/device.fidl 中定义
| 序数 | 变体 | 类型 | 说明 | 
|---|---|---|---|
1 | 
            response | 
            
                InputReportsReader_ReadInputReports_Response
             | 
            |
2 | 
            err | 
            
                zx/Status
             | 
            
常量
| 名称 | 值 | 类型 | 说明 | 
|---|---|---|---|
| CONSUMER_CONTROL_MAX_NUM_BUTTONS | 
                    255
                 | 
                uint32 | 
            ConsumerControl 向量的硬编码大小上限。如果我们看到设备上的对象数超过了可呈现的数量,那么这些大小就应该增加。  | 
        
| KEYBOARD_MAX_NUM_KEYS | 
                    256
                 | 
                uint32 | 
            键盘矢量的硬编码大小上限。如果我们发现键盘中的对象数量超过了可呈现的数量,那么这些大小应该会增加。  | 
        
| KEYBOARD_MAX_NUM_LEDS | 
                    256
                 | 
                uint32 | 
            |
| KEYBOARD_MAX_PRESSED_KEYS | 
                    256
                 | 
                uint32 | 
            |
| MAX_DEVICE_REPORT_COUNT | 
                    50
                 | 
                uint32 | 
            |
| MAX_REPORT_COUNT | 
                    255
                 | 
                uint32 | 
            报告数量上限的硬编码值。由于报告 ID 只有 8 位,因此一次最多只能有 255 个不同的报告。  | 
        
| MOUSE_MAX_NUM_BUTTONS | 
                    32
                 | 
                uint32 | 
            鼠标按钮数量上限(经过硬编码)。将来,如果我们看到鼠标带有更多按钮,此上限应该会增加。  | 
        
| SENSOR_MAX_VALUES | 
                    100
                 | 
                uint32 | 
            最大传感器值的硬编码数量。将来,如果我们发现传感器的值更多,则应增大此值。  | 
        
| TOUCH_MAX_CONTACTS | 
                    10
                 | 
                uint32 | 
            每个报告中联系人数量上限的硬编码。日后,如果我们发现设备数量超过上限,则应提高此上限。  | 
        
| TOUCH_MAX_NUM_BUTTONS | 
                    10
                 | 
                uint32 |