协议
DeviceIterator
在 fuchsia.ui.input/device_listener.fidl 中定义
用于迭代初始活跃设备集的协议。
此迭代器会在注册监听器时返回,用于通过已存在的设备引导客户端的状态。
GetNext
返回下一批活跃设备。
在遍历所有现有设备后返回空矢量。然后,客户端应关闭此通道,并依靠 DeviceListener 处理后续事件。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
devices |
vector<DeviceEvent>
|
DeviceListener
在 fuchsia.ui.input/device_listener.fidl 中定义
由客户端实现的回调协议,用于接收实时设备更改事件。
只有在注册完成后发生更改时,系统才会向此监听器发送事件。
OnDeviceChanged
在发生设备更改事件时调用。
请求
| 名称 | 类型 |
|---|---|
event |
DeviceEvent
|
DeviceListenerRegistry
在 fuchsia.ui.input/device_listener.fidl 中定义
允许客户端监控输入设备更改的注册表服务。
RegisterListener
注册一个监听器,以接收未来的设备更改事件。
返回一个 DeviceIterator,客户端必须使用该对象来清空注册时已处于活跃状态的设备列表。
请求
| 名称 | 类型 |
|---|---|
listener |
client_end:DeviceListener
|
响应
| 名称 | 类型 |
|---|---|
iterator |
client_end:DeviceIterator
|
ImeService
在 fuchsia.ui.input/ime_service.fidl 中定义
IME 提供的服务
GetInputMethodEditor
请求
| 名称 | 类型 |
|---|---|
keyboard_type |
KeyboardType
|
action |
InputMethodAction
|
initial_state |
TextInputState
|
client |
client_end:InputMethodEditorClient
|
editor |
server_end:InputMethodEditor
|
HideKeyboard
请求
<EMPTY>
ShowKeyboard
请求
<EMPTY>
InputDevice
在 fuchsia.ui.input/input_device_registry.fidl 中定义
DispatchReport
从设备 token 分派 InputReport
请求
| 名称 | 类型 |
|---|---|
report |
InputReport
|
InputMethodEditor
在 fuchsia.ui.input/text_input.fidl 中定义
用于与文本输入控件交互的接口。
DispatchKey3
请求
| 名称 | 类型 |
|---|---|
event |
fuchsia.ui.input3/KeyEvent
|
响应
| 名称 | 类型 |
|---|---|
handled |
bool
|
隐藏
请求
<EMPTY>
InjectInput
请求
| 名称 | 类型 |
|---|---|
event |
InputEvent
|
SetKeyboardType
请求
| 名称 | 类型 |
|---|---|
keyboard_type |
KeyboardType
|
SetState
请求
| 名称 | 类型 |
|---|---|
state |
TextInputState
|
显示
请求
<EMPTY>
InputMethodEditorClient
在 fuchsia.ui.input/text_input.fidl 中定义
用于接收来自 TextInputService 的信息的接口。
DidUpdateState
请求
| 名称 | 类型 |
|---|---|
state |
TextInputState
|
event |
InputEvent?
|
OnAction
请求
| 名称 | 类型 |
|---|---|
action |
InputMethodAction
|
STRUCTS
轴
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
range |
Range
|
无默认应用 | |
resolution |
int32
|
1 | |
scale |
AxisScale
|
AxisScale.LINEAR |
AxisF
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
range |
RangeF
|
无默认应用 | |
resolution |
float32
|
1 | |
scale |
AxisScale
|
AxisScale.LINEAR |
DeviceInfo
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
vendor_id |
uint32
|
无默认应用 | |
product_id |
uint32
|
无默认应用 | |
version |
uint32
|
无默认应用 | |
name |
string
|
无默认应用 |
FocusEvent
在 fuchsia.ui.input/input_events.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
event_time |
uint64
|
事件的传送时间。时间以纳秒为单位,对应于由 zx_clock_get_monotonic 系统调用确定的单调时间。 |
无默认应用 |
focused |
bool
|
视图是否已获得输入焦点。 |
无默认应用 |
InputReport
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
event_time |
uint64
|
无默认应用 | |
keyboard |
KeyboardReport?
|
无默认应用 | |
media_buttons |
MediaButtonsReport?
|
无默认应用 | |
mouse |
MouseReport?
|
无默认应用 | |
stylus |
StylusReport?
|
无默认应用 | |
touchscreen |
TouchscreenReport?
|
无默认应用 | |
sensor |
SensorReport?
|
无默认应用 | |
trace_id |
uint64
|
0 |
KeyboardEvent
在 fuchsia.ui.input/input_events.fidl 中定义
KeyboardEvent 表示用户与键盘互动时生成的事件。
这些事件由按键的不同按下状态变化触发。
状态转换应如下所示: PRESSED -> (REPEAT ->) RELEASED 或 PRESSED -> (REPEAT ->) CANCELLED
当码位可用时,输入系统会自动重复这些事件。
已弃用:将被移除,取而代之的是 fuchsia.ui.input.KeyEvent。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
event_time |
uint64
|
事件的传送时间。时间以纳秒为单位,对应于由 zx_clock_get_monotonic 系统调用确定的单调时间。 |
无默认应用 |
device_id |
uint32
|
无默认应用 | |
phase |
KeyboardEventPhase
|
无默认应用 | |
hid_usage |
uint32
|
键盘 HID 用法 请参阅 https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf |
无默认应用 |
code_point |
uint32
|
此按键事件表示的 Unicode 码位(如果有)。 静键表示为 Unicode 组合字符。 如果没有 Unicode 码位,则此值为零。 |
无默认应用 |
modifiers |
uint32
|
由不同 kModifier 常量定义的辅助键,例如当前按下的 |
无默认应用 |
KeyboardReport
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
pressed_keys |
vector<uint32>
|
无默认应用 |
MediaButtonsDescriptor
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
buttons |
uint32
|
无默认应用 |
MediaButtonsReport
在 fuchsia.ui.input/input_reports.fidl 中定义
MediaButtonsReport 描述了从事件流传递的媒体按钮事件。
报告中的每个 bool 都代表一个按钮,其中 true 表示按钮正在被按下。每次状态发生变化时,都应发送一份报告。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
volume_up |
bool
|
无默认应用 | |
volume_down |
bool
|
无默认应用 | |
mic_mute |
bool
|
无默认应用 | |
reset |
bool
|
无默认应用 | |
pause |
bool
|
无默认应用 | |
camera_disable |
bool
|
无默认应用 |
MouseReport
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
rel_x |
int32
|
无默认应用 | |
rel_y |
int32
|
无默认应用 | |
rel_hscroll |
int32
|
无默认应用 | |
rel_vscroll |
int32
|
无默认应用 | |
pressed_buttons |
uint32
|
无默认应用 |
PointerEvent
在 fuchsia.ui.input/input_events.fidl 中定义
指针表示有关用户与屏幕互动的原始数据。
状态转换应如下所示: ADD (-> HOVER) -> DOWN -> MOVE -> UP (-> HOVER) -> REMOVE
在初始 ADD 之后的任何时间点,也可以转换为 CANCEL。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
event_time |
uint64
|
事件的传送时间。时间以纳秒为单位,对应于由 zx_clock_get_monotonic 系统调用确定的单调时间。 |
无默认应用 |
device_id |
uint32
|
无默认应用 | |
pointer_id |
uint32
|
无默认应用 | |
type |
PointerEventType
|
无默认应用 | |
phase |
PointerEventPhase
|
无默认应用 | |
x |
float32
|
|
无默认应用 |
y |
float32
|
无默认应用 | |
radius_major |
float32
|
0 | |
radius_minor |
float32
|
0 | |
buttons |
uint32
|
当前按下的按钮,由 kButton 常量(例如 |
无默认应用 |
范围
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
min |
int32
|
无默认应用 | |
max |
int32
|
无默认应用 |
RangeF
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
min |
float32
|
无默认应用 | |
max |
float32
|
无默认应用 |
SendKeyboardInputCmd
在 fuchsia.ui.input/commands.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
compositor_id |
uint32
|
无默认应用 | |
keyboard_event |
KeyboardEvent
|
无默认应用 |
SendPointerInputCmd
在 fuchsia.ui.input/commands.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
compositor_id |
uint32
|
无默认应用 | |
pointer_event |
PointerEvent
|
无默认应用 |
SensorAxis
在 fuchsia.ui.input/device_descriptor.fidl 中定义
SensorAxis 是一个普通的 Axis,带有一个额外的 SensorType,用于描述轴测量的内容。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
axis |
fuchsia.input/Axis
|
无默认应用 | |
type |
SensorType
|
无默认应用 |
SetHardKeyboardDeliveryCmd
在 fuchsia.ui.input/commands.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
delivery_request |
bool
|
无默认应用 |
SetParallelDispatchCmd
在 fuchsia.ui.input/commands.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
parallel_dispatch |
bool
|
无默认应用 |
StylusDescriptor
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
x |
Axis
|
无默认应用 | |
y |
Axis
|
无默认应用 | |
pressure |
Axis?
|
无默认应用 | |
is_invertible |
bool
|
false | |
buttons |
uint32
|
无默认应用 |
StylusReport
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
x |
int32
|
无默认应用 | |
y |
int32
|
无默认应用 | |
pressure |
uint32
|
无默认应用 | |
is_in_contact |
bool
|
无默认应用 | |
in_range |
bool
|
无默认应用 | |
is_inverted |
bool
|
无默认应用 | |
pressed_buttons |
uint32
|
无默认应用 |
TextInputState
在 fuchsia.ui.input/text_input.fidl 中定义
用于修改一段文本的当前文本、所选内容和撰写状态。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
revision |
uint32
|
当前状态修订版本,用于避免出现竞态条件。 |
无默认应用 |
text |
string
|
当前正在修改的文本。 |
无默认应用 |
selection |
TextSelection
|
当前所选文本的范围。 |
无默认应用 |
composing |
TextRange
|
仍在撰写的文本范围。 |
无默认应用 |
TextRange
在 fuchsia.ui.input/text_editing.fidl 中定义
字符串中的一系列字符。虽然 FIDL 传输格式中的字符串采用 UTF-8 编码,但出于历史原因,这些索引以 UTF-16 代码单元为单位。这些文本输入 API 最终将被 fuchsia.ui.text 取代,后者改用码位。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
start |
int64
|
范围内第一个 UTF-16 代码单元的索引。 如果 |
-1 |
end |
int64
|
此范围内最后一个 UTF-16 代码单元之后的下一个索引。 如果 |
-1 |
TextSelection
在 fuchsia.ui.input/text_editing.fidl 中定义
表示所选内容的一系列文本。虽然 FIDL 传输格式中的字符串采用 UTF-8 编码,但出于历史原因,这些索引以 UTF-16 代码单元为单位。这些文本输入 API 最终将被 fuchsia.ui.text 取代,后者改用码位。
文本选择始终具有方向性。应通过比较基准和范围来确定方向。
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
base |
int64
|
所选内容的起始偏移量,以 UTF-16 代码单元为单位。 可能大于、小于或等于 extent。 |
无默认应用 |
extent |
int64
|
所选内容终止处的偏移量,以 UTF-16 代码单元为单位。 当用户使用箭头键调整所选内容时,此值会发生变化。同样,如果当前主题在所选内容的一侧绘制光标,则这是绘制光标的位置。 可能大于、小于或等于基准。 |
无默认应用 |
affinity |
TextAffinity
|
如果文本范围已收起且具有多个视觉位置(例如,出现在换行符处),则在绘制光标时使用这两个位置中的哪一个。 |
无默认应用 |
触摸
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
finger_id |
uint32
|
无默认应用 | |
x |
int32
|
无默认应用 | |
y |
int32
|
无默认应用 | |
width |
uint32
|
无默认应用 | |
height |
uint32
|
无默认应用 |
TouchscreenDescriptor
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
x |
Axis
|
无默认应用 | |
y |
Axis
|
无默认应用 | |
max_finger_id |
uint32
|
无默认应用 |
TouchscreenReport
在 fuchsia.ui.input/input_reports.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
touches |
vector<Touch>
|
无默认应用 |
枚举
操作灵活
类型:uint32
在 fuchsia.ui.input/device_listener.fidl 中定义
描述输入设备发生的更改类型。
| 名称 | 值 | 说明 |
|---|---|---|
ADDED |
1 |
添加了新设备。 |
已更新 |
2 |
现有设备已更新(例如,属性已更改)。 |
已移除 |
3 |
已移除一部设备。 |
AxisScale flexible
类型:uint32
在 fuchsia.ui.input/input_reports.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
线性 |
0 |
|
对数 |
1 |
InputMethodAction flexible
类型:uint32
在 fuchsia.ui.input/text_input.fidl 中定义
确定按下键盘上的“操作”键时会发生什么,通常是物理键盘上的“Enter”键,或虚拟键盘上的操作按钮(通常放置在 Enter 键所在的位置,但带有自定义标签)。
| 名称 | 值 | 说明 |
|---|---|---|
未指定 |
0 |
根本未指定方法操作。 |
无 |
1 |
您无需执行任何特殊操作。 |
前往 |
2 |
操作为“Go”,例如执行命令。 |
SEARCH |
3 |
该操作会调用搜索。 |
发送 |
4 |
该操作用于调用“发送”,例如,如果这是电子邮件或短信。 |
继续 |
5 |
该操作是移至焦点序列中的下一个字段。 |
完成 |
6 |
该操作用于结束文本编辑。 |
上一步 |
7 |
该操作会移至焦点序列中的上一个字段。 |
NEWLINE |
8 |
按快捷操作按键会在文本字段中插入新行。这与其他值不同,其他值都会停止编辑并调用特定操作。 添加:8
|
KeyboardEventPhase 灵活
类型:uint32
在 fuchsia.ui.input/input_events.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
PRESSED |
0 |
按下按键时。 |
新歌速递 |
1 |
松开按键时。 |
已取消 |
2 |
此密钥 |
REPEAT |
3 |
这是否是自动生成的按键重复 |
KeyboardType flexible
类型:uint32
在 fuchsia.ui.input/text_input.fidl 中定义
向文本编辑子系统请求特定键盘类型。
这与虚拟键盘最相关,因为虚拟键盘在向用户呈现键盘的方式以及可接受的输入方面有一定的自由度。
例如,NUMBER 键盘类型可能仅允许输入十进制数字。此外,虚拟键盘可能仅显示数字键盘,以便输入文本。
| 名称 | 值 | 说明 |
|---|---|---|
TEXT |
0 |
仅限单行文本字段。对于多行文本,请使用下方的 MULTILINE。 |
NUMBER |
1 |
仅用于输入数字的文本字段。 |
电话 |
2 |
仅用于输入电话号码的文本字段(例如数字、有限的标点符号,可能还有一些验证)。 |
DATETIME |
3 |
用于输入日期和时间的文本字段。例如,侧边可能有一个日历 widget,用于帮助输入日期时间。 |
MULTILINE |
4 |
多行文本。 新增:8
|
灵活的 LedType
类型:uint32
在 fuchsia.ui.input/device_descriptor.fidl 中定义
LedType 表示设备上可以开启或关闭的 LED。
| 名称 | 值 | 说明 |
|---|---|---|
NUM_LOCK |
1 |
|
CAPS_LOCK |
2 |
|
SCROLL_LOCK |
3 |
|
COMPOSE |
4 |
|
KANA |
5 |
PointerEventPhase strict
类型:uint32
在 fuchsia.ui.input/input_events.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
添加 |
0 |
设备已开始跟踪指针。 例如,指针可能悬停在设备上方,尚未与设备表面接触。 |
悬停 |
1 |
指针在未与设备接触的情况下相对于设备移动。 |
DOWN |
2 |
指针已与设备接触。 对于 |
移动 |
3 |
指针在与设备接触时相对于设备移动。 |
UP |
4 |
指针已停止与设备接触。 对于 |
移除 |
5 |
设备不再跟踪指针。 例如,指针可能已漂移到设备的悬停检测范围之外,或者可能已与系统完全断开连接。 |
取消 |
6 |
指针的输入不再指向此接收器。 |
PointerEventType strict
类型:uint32
在 fuchsia.ui.input/input_events.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
触摸 |
0 |
基于触摸的指控设备。 |
STYLUS |
1 |
带有触控笔的指控设备。 |
INVERTED_STYLUS |
2 |
带有已倒置触控笔的指控设备。 |
鼠标 |
3 |
不带触控笔的指控设备。 |
SensorLocation flexible
类型:uint32
在 fuchsia.ui.input/input_reports.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
未知 |
0 |
|
BASE |
1 |
|
LID |
2 |
SensorType flexible
类型:uint32
在 fuchsia.ui.input/device_descriptor.fidl 中定义
每个传感器值都有一个对应的 SensorType,用于说明该值在现实世界中测量的是什么。
| 名称 | 值 | 说明 |
|---|---|---|
ACCELEROMETER_X |
1 |
|
ACCELEROMETER_Y |
2 |
|
ACCELEROMETER_Z |
3 |
|
MAGNETOMETER_X |
4 |
|
MAGNETOMETER_Y |
5 |
|
MAGNETOMETER_Z |
6 |
|
GYROSCOPE_X |
7 |
|
GYROSCOPE_Y |
8 |
|
GYROSCOPE_Z |
9 |
|
LIGHT_ILLUMINANCE |
10 |
|
LIGHT_RED |
11 |
|
LIGHT_GREEN |
12 |
|
LIGHT_BLUE |
13 |
TextAffinity strict
类型:uint32
在 fuchsia.ui.input/text_editing.fidl 中定义
TextPosition 在视觉上是位于其偏移量的上游还是下游。
例如,当文本位置存在于换行符处时,单个偏移量具有两个视觉位置,一个在换行符之前(在第一行的末尾),另一个在换行符之后(在第二行的开头)。文本相似度可消除这些情况之间的歧义。(在双向文本的运行之间也会发生类似的情况。)
我们预计不会向此枚举添加新值。
| 名称 | 值 | 说明 |
|---|---|---|
上游 |
0 |
该位置与文本位置的上游侧具有亲和性。 例如,如果文本位置的偏移量是换行符,则该位置表示第一行的末尾。 |
DOWNSTREAM |
1 |
该位置与文本位置的下游侧具有亲和性。 例如,如果文本位置的偏移量是换行符,则该位置表示第二行的开头。 |
TouchButton 柔性
类型:uint32
在 fuchsia.ui.input/input_events.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
PALM |
1 |
|
SWIPE_UP |
2 |
表示在触摸屏上向上滑动的手势。 新增:31
|
SWIPE_LEFT |
3 |
表示在触摸屏上向左滑动手势。 新增:31
|
SWIPE_RIGHT |
4 |
表示在触摸屏上向右滑动的手势。 新增:31
|
SWIPE_DOWN |
5 |
表示在触摸屏上向下滑动的手势。 新增:31
|
TouchType 弹性
类型:uint32
在 fuchsia.ui.input/device_descriptor.fidl 中定义
发起触摸的设备类型。
| 名称 | 值 | 说明 |
|---|---|---|
触摸屏 |
1 |
|
触控板 |
2 |
TABLES
ConsumerControlDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
Fuchsia ConsumerControl 表示用于更改主机上的值的设备。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
input |
ConsumerControlInputDescriptor
|
ConsumerControlInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述将从 ConsumerControl 设备发送到主机的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
buttons |
vector<fuchsia.input/ConsumerControlButton>:255
|
ContactInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
ContactInputDescriptor 描述了与触摸设备上的触摸操作相关联的字段。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
position_x |
fuchsia.input/Axis
|
|
2 |
position_y |
fuchsia.input/Axis
|
|
3 |
pressure |
fuchsia.input/Axis
|
|
4 |
contact_width |
fuchsia.input/Axis
|
|
5 |
contact_height |
fuchsia.input/Axis
|
DeviceDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
DeviceDescriptor 描述了实体输入设备。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
device_information |
DeviceInformation
|
标识实体设备。 |
2 |
mouse |
MouseDescriptor
|
描述设备的鼠标部分。 |
3 |
sensor |
SensorDescriptor
|
描述设备的传感器部分。 |
4 |
touch |
TouchDescriptor
|
描述设备的触摸部分。 |
5 |
keyboard |
KeyboardDescriptor
|
描述设备的键盘部分。 |
6 |
consumer_control |
ConsumerControlDescriptor
|
描述设备的消费者控制部分。 |
DeviceEvent
在 fuchsia.ui.input/device_listener.fidl 中定义
表示与输入设备更改相关联的事件。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
action |
Action
|
触发此事件的操作。 |
2 |
device_id |
uint32
|
设备的唯一标识符。 |
3 |
descriptor |
DeviceDescriptor
|
包含设备详细信息的描述符。 |
DeviceInformation
在 fuchsia.ui.input/device_descriptor.fidl 中定义
DeviceInformation 可提供有关设备的更多信息,并让客户端能够区分设备(例如,区分来自不同供应商的两个触摸屏)。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
vendor_id |
uint32
|
必填。 |
2 |
product_id |
uint32
|
必填。 |
3 |
version |
uint32
|
可选。 |
4 |
polling_rate |
zx/Duration
|
每次轮询设备之间的时间间隔。 可选。 |
5 |
manufacturer_name |
string:256
|
制造商的人类可读名称。可选。 如果存在,则必须为非空。 |
6 |
product_name |
string:256
|
人类可读的产品名称。可选。 如果存在,则必须为非空。 |
7 |
serial_number |
string:256
|
设备的序列号。可选。 如果存在,则必须为非空。 |
KeyboardDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
键盘设备的功能。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
input |
KeyboardInputDescriptor
|
|
2 |
output |
KeyboardOutputDescriptor
|
KeyboardInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述将从键盘发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
keys |
vector<fuchsia.input/Key>:256
|
此键盘包含的按键列表。 |
KeyboardOutputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述可发送到键盘的输出报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
leds |
vector<LedType>:256
|
可切换的键盘 LED 列表。 |
MediaButtonsEvent 资源
在 fuchsia.ui.input/input_events.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
volume |
int8
|
净音量变化方向:按下音量调高键时为 +1,按下音量调低键时为 -1,两者都未按下或都按下时为 0。
如果需要离散按钮状态(例如,检测同时按下的情况),请首选 |
2 |
mic_mute |
bool
|
|
3 |
pause |
bool
|
|
4 |
camera_disable |
bool
|
|
5 |
power |
bool
|
|
6 |
function |
bool
|
|
7 |
device_id |
uint32
|
|
8 |
wake_lease |
handle<eventpair>
|
用于电源接力棒传递的可选唤醒租约。 |
9 |
trace_flow_id |
uint64
|
用于连接事件流的可选跟踪流 ID。 |
10 |
volume_up |
bool
|
是否按下了音量调高按钮。与 |
11 |
volume_down |
bool
|
是否按下了音量调低按钮。如需了解这与净交易量字段的关系,请参阅 |
MouseDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
鼠标设备的功能。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
input |
MouseInputDescriptor
|
描述设备的输入功能。 |
MouseInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述将从鼠标发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
movement_x |
fuchsia.input/Axis
|
相对 X 轴移动的范围。 |
2 |
movement_y |
fuchsia.input/Axis
|
相对 Y 轴移动的范围。 |
3 |
scroll_v |
fuchsia.input/Axis
|
相对垂直滚动范围。 |
4 |
scroll_h |
fuchsia.input/Axis
|
相对水平滚动范围。 |
5 |
buttons |
vector<uint8>:32
|
鼠标按键的 ID。 |
6 |
position_x |
fuchsia.input/Axis
|
X 的位置范围。 |
7 |
position_y |
fuchsia.input/Axis
|
Y 轴位置的范围。 |
SensorDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
传感器设备的功能。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
input |
SensorInputDescriptor
|
SensorInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述将从传感器发送到设备的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
values |
vector<SensorAxis>:100
|
TouchButtonsEvent 资源
在 fuchsia.ui.input/input_events.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
event_time |
zx/InstantMono
|
|
2 |
device_info |
TouchDeviceInfo
|
|
3 |
pressed_buttons |
vector<TouchButton>
|
|
4 |
wake_lease |
handle<eventpair>
|
用于电源接力棒传递的可选唤醒租约。 |
5 |
trace_flow_id |
uint64
|
用于连接事件流的可选跟踪流 ID。 |
TouchDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
触摸设备的功能。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
input |
TouchInputDescriptor
|
|
2 |
feature |
TouchFeatureDescriptor
|
TouchDeviceInfo
在 fuchsia.ui.input/input_events.fidl 中定义
关于发出触摸事件流的设备的信息。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
id |
uint32
|
发出触摸事件的触摸设备的标识符。 必填。 |
TouchFeatureDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述触控板配置的功能报告格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
supports_input_mode |
bool
|
|
2 |
supports_selective_reporting |
bool
|
TouchInputDescriptor
在 fuchsia.ui.input/device_descriptor.fidl 中定义
描述将从触摸设备发送到主机的输入报告的格式。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
contacts |
vector<ContactInputDescriptor>:10
|
|
2 |
max_contacts |
uint32
|
|
3 |
touch_type |
TouchType
|
|
4 |
buttons |
vector<TouchButton>:10
|
UNIONS
命令 strict
在 fuchsia.ui.input/commands.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
send_keyboard_input |
SendKeyboardInputCmd
|
|
2 |
send_pointer_input |
SendPointerInputCmd
|
|
3 |
set_hard_keyboard_delivery |
SetHardKeyboardDeliveryCmd
|
|
4 |
set_parallel_dispatch |
SetParallelDispatchCmd
|
InputEvent strict
在 fuchsia.ui.input/input_events.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
pointer |
PointerEvent
|
已弃用:10
|
2 |
keyboard |
KeyboardEvent
|
已弃用:13
|
3 |
focus |
FocusEvent
|
已弃用:10
|
SensorReport strict
在 fuchsia.ui.input/input_reports.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
vector |
array<int16, 3>
|
|
2 |
scalar |
uint16
|
常量
| 名称 | 值 | 类型 | 说明 |
|---|---|---|---|
| CONSUMER_CONTROL_MAX_NUM_BUTTONS |
fuchsia.input/CONSUMER_CONTROL_MAX_NUM_BUTTONS
|
uint32 |
Added: HEAD
|
| KEYBOARD_MAX_NUM_KEYS |
256
|
uint32 |
Added: HEAD
|
| KEYBOARD_MAX_NUM_LEDS |
256
|
uint32 |
Added: HEAD
|
| MAX_NAME_LENGTH |
256
|
uint32 |
Added: HEAD
|
| MOUSE_MAX_NUM_BUTTONS |
fuchsia.input/MOUSE_MAX_NUM_BUTTONS
|
uint32 |
Added: HEAD
|
| SENSOR_MAX_VALUES |
100
|
uint32 |
Added: HEAD
|
| TOUCH_MAX_CONTACTS |
fuchsia.input/TOUCH_MAX_CONTACTS
|
uint32 |
Added: HEAD
|
| TOUCH_MAX_NUM_BUTTONS |
fuchsia.input/TOUCH_MAX_NUM_BUTTONS
|
uint32 |
Added: HEAD
|
| kModifierAlt |
96
|
uint32 |
已弃用:13
|
| kModifierCapsLock |
1
|
uint32 |
已弃用:13
|
| kModifierControl |
24
|
uint32 |
已弃用:13
|
| kModifierLeftAlt |
32
|
uint32 |
已弃用:13
|
| kModifierLeftControl |
8
|
uint32 |
已弃用:13
|
| kModifierLeftShift |
2
|
uint32 |
已弃用:13
|
| kModifierLeftSuper |
128
|
uint32 |
已弃用:13
|
| kModifierNone |
0
|
uint32 |
键盘修饰键 已弃用:13
|
| kModifierRightAlt |
64
|
uint32 |
已弃用:13
|
| kModifierRightControl |
16
|
uint32 |
已弃用:13
|
| kModifierRightShift |
4
|
uint32 |
已弃用:13
|
| kModifierRightSuper |
256
|
uint32 |
已弃用:13
|
| kModifierShift |
6
|
uint32 |
已弃用:13
|
| kModifierSuper |
384
|
uint32 |
已弃用:13
|