协议
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 之前创建了过多的 InputReport,则将静默舍弃最早的 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
|
无默认取景方式 | |
polling_rate |
zx/Duration
|
轮询率(如果适用) 添加了:HEAD
|
无默认取景方式 |
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 |
SensorReportingState 灵活
类型:uint32
在 fuchsia.input.report/sensor.fidl 中定义
SensorReportingState
用于确定传感器何时发送报告。
名称 | 值 | 说明 |
---|---|---|
REPORT_NO_EVENTS |
1 |
传感器不会发送任何事件。 |
REPORT_ALL_EVENTS |
2 |
所有事件都将从传感器发送。对于大多数传感器,此频率可以通过 |
REPORT_THRESHOLD_EVENTS |
3 |
系统只会报告超出阈值的事件。 |
SensorType 灵活
类型: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 灵活
类型:uint32
在 fuchsia.input.report/touch.fidl 中定义
一种输入模式,指示应将哪个顶级集合用于输入报告。 这些值必须对应于通用串行总线 (USB) 规范 (https://usb.org/sites/default/files/hut1_22.pdf) 的 16.7 版 HID 用途表中定义的输入模式。
名称 | 值 | 说明 |
---|---|---|
MOUSE_COLLECTION |
0 |
使用鼠标收集工具来报告数据。 |
WINDOWS_PRECISION_TOUCHPAD_COLLECTION |
3 |
使用 Windows 精确触控板集合来报告数据。由 Windows Precision Touchpad 必要的 HID 顶层集合定义:https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-全新-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 |
距离测量值(以米为单位)。 |
格 |
3 |
质量的测量值,以克为单位。 |
学位 |
4 |
旋转的测量值(以度为单位)。 |
ENGLISH_ANGULAR_VELOCITY |
5 |
角速度测量值,以每秒度为单位。 |
SI_LINEAR_VELOCITY |
6 |
线性速度测量值,以米/秒为单位。 |
SI_LINEAR_ACCELERATION |
7 |
以米/秒平方为单位的加速度测量值。 |
韦伯 |
8 |
韦伯尔磁通量的测量单位。 |
吊灯 |
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 |
供应商 ID 灵活
类型:uint32
在 fuchsia.input.report/device_ids.fidl 中定义
VendorId 表示创建此输入设备的供应商。如果输入设备是 HID 设备,则 VendorId 会直接映射到 HID VendorId。如果输入设备不是 HID 设备,则 VendorId 将大于 0xFFFF(这是最大 HID VendorId)。
名称 | 值 | 说明 |
---|---|---|
6353 |
以下是 HID VendorId,范围为 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
|
|
2 |
mouse |
MouseDescriptor
|
如果存在 |
3 |
sensor |
SensorDescriptor
|
如果存在 |
4 |
touch |
TouchDescriptor
|
如果存在 |
5 |
keyboard |
KeyboardDescriptor
|
如果存在 |
6 |
consumer_control |
ConsumerControlDescriptor
|
如果存在 |
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
|
如果设备包含 ConsumerControl 设备, |
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 严格
在 fuchsia.input.report/device.fidl 中定义
序数 | 变体 | 类型 | 说明 |
---|---|---|---|
1 |
response |
InputDevice_GetFeatureReport_Response
|
|
2 |
err |
zx/Status
|
InputDevice_GetInputReport_Result 严格
在 fuchsia.input.report/device.fidl 中定义
序数 | 变体 | 类型 | 说明 |
---|---|---|---|
1 |
response |
InputDevice_GetInputReport_Response
|
|
2 |
err |
zx/Status
|
InputDevice_SendOutputReport_Result 严格
在 fuchsia.input.report/device.fidl 中定义
序数 | 变体 | 类型 | 说明 |
---|---|---|---|
1 |
response |
InputDevice_SendOutputReport_Response
|
|
2 |
err |
zx/Status
|
InputDevice_SetFeatureReport_Result 严格
在 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 |