通訊協定
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
Axis
定義於 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 syscall 決定的單調時間。 |
無預設值 |
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 syscall 決定的單調時間。 |
無預設值 |
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 描述從事件串流傳送的媒體按鈕事件。報表中的每個布林值都代表一個按鈕,其中 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 syscall 決定的單調時間。 |
無預設值 |
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
|
否 | |
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 |
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
說明輸入裝置發生的變更類型。
| 名稱 | 值 | 說明 |
|---|---|---|
已新增 |
1 |
已新增裝置。 |
更新 |
2 |
現有裝置已更新 (例如屬性變更)。 |
已移除 |
3 |
已移除裝置。 |
AxisScale 彈性
類型:uint32
定義於 fuchsia.ui.input/input_reports.fidl
| 名稱 | 值 | 說明 |
|---|---|---|
線性 |
0 |
|
對數 |
1 |
InputMethodAction 彈性
類型:uint32
定義於 fuchsia.ui.input/text_input.fidl
決定按下鍵盤上的「動作」鍵時會發生什麼事,通常是實體鍵盤上的「Enter」鍵,或虛擬鍵盤上的動作按鈕,通常會放在 Enter 鍵的位置,但有自訂標籤。
| 名稱 | 值 | 說明 |
|---|---|---|
UNSPECIFIED |
0 |
完全未指定方法動作。 |
無 |
1 |
不需特別操作。 |
GO |
2 |
動作為「執行」,例如執行指令。 |
搜尋 |
3 |
動作是叫用搜尋。 |
傳送 |
4 |
這項動作會叫用「傳送」,例如傳送電子郵件或簡訊。 |
NEXT |
5 |
動作是移至焦點序列中的下一個欄位。 |
完成 |
6 |
這個動作會結束文字編輯。 |
上一步 |
7 |
這個動作會移至焦點序列中的上一個欄位。 |
NEWLINE |
8 |
按下快捷操作鍵,即可在文字欄位中插入新的一行。其他值則會停止編輯並叫用特定動作。 新增:8
|
KeyboardEventPhase 彈性
類型:uint32
定義於 fuchsia.ui.input/input_events.fidl
| 名稱 | 值 | 說明 |
|---|---|---|
PRESSED |
0 |
按下按鍵時。 |
新上架 |
1 |
放開按鍵時。 |
已取消 |
2 |
這個按鍵 |
重複 |
3 |
這是否為自動產生的按鍵重複 |
KeyboardType flexible
類型:uint32
定義於 fuchsia.ui.input/text_input.fidl
向文字編輯子系統要求特定鍵盤類型。
這項功能最適合虛擬鍵盤,因為虛擬鍵盤在向使用者呈現鍵盤的方式,以及可接受的輸入內容方面,都有一定的彈性。
舉例來說,NUMBER 鍵盤類型可能只允許輸入十進位數字。此外,虛擬鍵盤可能只會顯示數字鍵盤,供使用者輸入文字。
| 名稱 | 值 | 說明 |
|---|---|---|
文字 |
0 |
僅限單行文字欄位。如要輸入多行文字,請使用下方的 MULTILINE。 |
NUMBER |
1 |
僅用於輸入數字的文字欄位。 |
手機 |
2 |
僅用於輸入電話號碼的文字欄位 (例如數字、有限的標點符號,可能還有一些驗證)。 |
DATETIME |
3 |
輸入日期和時間的文字欄位。例如,側邊可能有日曆小工具,協助輸入日期時間。 |
MULTILINE |
4 |
多行文字。 新增:8
|
LedType flexible
類型:uint32
定義於 fuchsia.ui.input/device_descriptor.fidl
LedType 代表裝置上可開啟或關閉的 LED。
| 名稱 | 值 | 說明 |
|---|---|---|
NUM_LOCK |
1 |
|
CAPS_LOCK |
2 |
|
SCROLL_LOCK |
3 |
|
撰寫 |
4 |
|
KANA |
5 |
PointerEventPhase strict
類型:uint32
定義於 fuchsia.ui.input/input_events.fidl
| 名稱 | 值 | 說明 |
|---|---|---|
ADD |
0 |
裝置已開始追蹤指標。 舉例來說,指標可能懸停在裝置上方,尚未與裝置表面接觸。 |
HOVER |
1 |
指標已相對於裝置移動,但未與裝置接觸。 |
下 |
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 在視覺上是否位於其偏移的上游或下游。
舉例來說,如果文字位置位於換行處,單一偏移量會有兩個視覺位置,一個在換行前 (第一行結尾),另一個在換行後 (第二行開頭)。文字相似度可區分這些情況。(雙向文字的執行之間也會發生類似情況)。
我們不預期會在這個列舉中加入新值。
| 名稱 | 值 | 說明 |
|---|---|---|
UPSTREAM |
0 |
這個位置與文字位置的上游端有親和性。 舉例來說,如果文字位置的偏移值是換行,則該位置代表第一行的結尾。 |
下游 |
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
|
裝置的專屬 ID。 |
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
|
發出觸控事件的觸控裝置 ID。必填。 |
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
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
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
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
pointer |
PointerEvent
|
已淘汰:10
|
2 |
keyboard |
KeyboardEvent
|
已淘汰:13
|
3 |
focus |
FocusEvent
|
已淘汰:10
|
SensorReport strict
定義於 fuchsia.ui.input/input_reports.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
vector |
array<int16, 3>
|
|
2 |
scalar |
uint16
|
常數
| 名稱 | 值 | 類型 | 說明 |
|---|---|---|---|
| CONSUMER_CONTROL_MAX_NUM_BUTTONS |
fuchsia.input/CONSUMER_CONTROL_MAX_NUM_BUTTONS
|
uint32 |
新增:HEAD
|
| KEYBOARD_MAX_NUM_KEYS |
256
|
uint32 |
新增:HEAD
|
| KEYBOARD_MAX_NUM_LEDS |
256
|
uint32 |
新增:HEAD
|
| MAX_NAME_LENGTH |
256
|
uint32 |
新增:HEAD
|
| MOUSE_MAX_NUM_BUTTONS |
fuchsia.input/MOUSE_MAX_NUM_BUTTONS
|
uint32 |
新增:HEAD
|
| SENSOR_MAX_VALUES |
100
|
uint32 |
新增:HEAD
|
| TOUCH_MAX_CONTACTS |
fuchsia.input/TOUCH_MAX_CONTACTS
|
uint32 |
新增:HEAD
|
| TOUCH_MAX_NUM_BUTTONS |
fuchsia.input/TOUCH_MAX_NUM_BUTTONS
|
uint32 |
新增: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
|