fuchsia.ui.input

新增日期:7

通訊協定

ImeService

fuchsia.ui.input/ime_service.fidl 中定義

輸入法編輯器提供的服務

GetInputMethodEditor

要求

名稱類型
keyboard_type KeyboardType
action InputMethodAction
initial_state TextInputState
client InputMethodEditorClient
editor server_end<InputMethodEditor>

HideKeyboard

要求

<EMPTY>

ShowKeyboard

要求

<EMPTY>

InputDevice

fuchsia.ui.input/input_device_registry.fidl 中定義

已淘汰:13

DispatchReport

透過裝置 token 調派 InputReport

要求

名稱類型
report InputReport

InputMethodEditor

定義於 fuchsia.ui.input/text_input.fidl

與文字輸入控制項互動的介面。

DispatchKey3

已淘汰:8

要求

名稱類型
event fuchsia.ui.input3/KeyEvent

回應

名稱類型
handled bool

隱藏

已淘汰:13

要求

<EMPTY>

InjectInput

已淘汰:8

要求

名稱類型
event InputEvent

SetKeyboardType

要求

名稱類型
keyboard_type KeyboardType

SetState

要求

名稱類型
state TextInputState

顯示

已淘汰:13

要求

<EMPTY>

InputMethodEditorClient

定義於 fuchsia.ui.input/text_input.fidl

用於接收 TextInputService 資訊的介面。

DidUpdateState

要求

名稱類型
state TextInputState
event InputEvent?

OnAction

要求

名稱類型
action InputMethodAction

結構化

Axis

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
range Range 無預設
resolution int32 1
scale AxisScale AxisScale.LINEAR

AxisF

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
range RangeF 無預設
resolution float32 1
scale AxisScale AxisScale.LINEAR

DeviceDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
device_info DeviceInfo? 無預設
keyboard KeyboardDescriptor? 無預設
media_buttons MediaButtonsDescriptor? 無預設
mouse MouseDescriptor? 無預設
stylus StylusDescriptor? 無預設
touchscreen TouchscreenDescriptor? 無預設
sensor SensorDescriptor? 無預設

DeviceInfo

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
vendor_id uint32 無預設
product_id uint32 無預設
version uint32 無預設
name string 無預設

FocusEvent

fuchsia.ui.input/input_events.fidl 中定義

已淘汰:10

廣闊類型說明預設
event_time uint64

傳送事件的時間。時間以奈秒為單位,對應由 zx_clock_get_monotonic 系統呼叫決定的單聲道時間。

無預設
focused bool

檢視畫面是否取得聚焦輸入。

無預設

InputReport

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
event_time uint64 無預設
keyboard KeyboardReport? 無預設
media_buttons MediaButtonsReport? 無預設
mouse MouseReport? 無預設
stylus StylusReport? 無預設
touchscreen TouchscreenReport? 無預設
sensor SensorReport? 無預設
trace_id uint64 0

KeyboardDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
keys vector<uint32> 無預設

KeyboardEvent

fuchsia.ui.input/input_events.fidl 中定義

KeyboardEvent 代表使用者與鍵盤互動所產生的事件。

這些事件是由按下不同按鍵狀態變更所觸發。

狀態轉換應如下所示: PRESSED -> (REPEAT ->) RELEASED 或 PRESSED -> (REPEAT ->) CANCELLED

可以使用 code_point 時,輸入系統會自動重複這些事件。

已淘汰:這會移除,並改用 fuchsia.ui.input.KeyEvent

已淘汰:13

廣闊類型說明預設
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 常數定義的按鍵修飾符 (例如目前按下的 kModifierCapsLock)

無預設

KeyboardReport

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
pressed_keys vector<uint32> 無預設

MediaButtonsDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
buttons uint32 無預設

MediaButtonsReport

定義於 fuchsia.ui.input/input_reports.fidl

MediaButtonsReport 說明從事件串流傳送的媒體按鈕事件。報表中的每個布林值都代表一個按鈕,true 表示按下了按鈕。每次狀態變更時,應傳送一份報告。

已淘汰:13

廣闊類型說明預設
volume_up bool 無預設
volume_down bool 無預設
mic_mute bool 無預設
reset bool 無預設
pause bool 無預設
camera_disable bool 無預設

MouseDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
rel_x Axis 無預設
rel_y Axis 無預設
vscroll Axis? 無預設
hscroll Axis? 無預設
buttons uint32 無預設

MouseReport

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
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。

已淘汰:10

廣闊類型說明預設
event_time uint64

傳送事件的時間。時間以奈秒為單位,對應由 zx_clock_get_monotonic 系統呼叫決定的單聲道時間。

無預設
device_id uint32 無預設
pointer_id uint32 無預設
type PointerEventType 無預設
phase PointerEventPhase 無預設
x float32

xy 位於 View 的座標系統中。

無預設
y float32 無預設
radius_major float32 0
radius_minor float32 0
buttons uint32

目前按下的按鈕是由定義為 kButton 常數,例如 kMousePrimaryButton

無預設

範圍

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
min int32 無預設
max int32 無預設

RangeF

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
min float32 無預設
max float32 無預設

SendKeyboardInputCmd

定義於 fuchsia.ui.input/commands.fidl

已淘汰:10

廣闊類型說明預設
compositor_id uint32 無預設
keyboard_event KeyboardEvent 無預設

SendPointerInputCmd

定義於 fuchsia.ui.input/commands.fidl

已淘汰:10

廣闊類型說明預設
compositor_id uint32 無預設
pointer_event PointerEvent 無預設

SensorDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
type SensorType 無預設
loc SensorLocation 無預設
min_sampling_freq uint32 無預設
max_sampling_freq uint32 無預設
fifo_max_event_count uint32 無預設
phys_min int32 無預設
phys_max int32 無預設

SetHardKeyboardDeliveryCmd

定義於 fuchsia.ui.input/commands.fidl

已淘汰:10

廣闊類型說明預設
delivery_request bool 無預設

SetParallelDispatchCmd

定義於 fuchsia.ui.input/commands.fidl

已淘汰:10

廣闊類型說明預設
parallel_dispatch bool 無預設

StylusDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
x Axis 無預設
y Axis 無預設
pressure Axis? 無預設
is_invertible bool false
buttons uint32 無預設

StylusReport

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
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 代碼單元的索引。

如果 startend 皆為 -1,則文字範圍會是空白。

-1
end int64

此範圍內最後一個 UTF-16 代碼單元後方的下一個索引。

如果 startend 皆為 -1,則文字範圍會是空白。

-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

已淘汰:13

廣闊類型說明預設
finger_id uint32 無預設
x int32 無預設
y int32 無預設
width uint32 無預設
height uint32 無預設

TouchscreenDescriptor

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
x Axis 無預設
y Axis 無預設
max_finger_id uint32 無預設

TouchscreenReport

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

廣闊類型說明預設
touches vector<Touch> 無預設

ENUMS

AxisScale 彈性

類型:uint32

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

名稱說明
0
1

InputMethodAction 彈性

類型:uint32

定義於 fuchsia.ui.input/text_input.fidl

決定當按下鍵盤上的「action」鍵時會發生什麼事,通常是實體鍵盤上的「Enter」鍵,或者虛擬鍵盤上的動作按鈕。這些按鈕通常位於 Enter 的位置,但含有自訂標籤。

名稱說明
0

未指定方法動作。

1

無須採取任何特殊動作。

2

動作為「Go」,例如執行指令。

3

這個動作是要叫用搜尋。

4

這個動作是叫用「傳送」,如這是電子郵件或簡訊。

5

這項操作會移至焦點序列中的下一個欄位。

6

這項操作會結束文字編輯作業。

7

這項操作會移至焦點序列中的上一個欄位。

8

按下動作鍵即可在文字欄位中插入新的一行。相對於其他值,所有值都會停止編輯並叫用特定動作。

新增日期:8

KeyboardEventPhase 彈性

類型:uint32

fuchsia.ui.input/input_events.fidl 中定義

已淘汰:13

名稱說明
0

按下按鍵時。

1

釋出金鑰時。

2

這個金鑰「PRESSED」已不再導向這個輸入用戶端。

3

這是否為自動產生的金鑰重複

KeyboardType 彈性

類型:uint32

定義於 fuchsia.ui.input/text_input.fidl

向文字編輯子系統要求特定鍵盤類型。

這與虛擬鍵盤在為使用者提供鍵盤方式方面有一定程度的表現,以及可接受的輸入方式。

舉例來說,NUMBER 鍵盤類型可能只允許輸入十進位數字。此外,虛擬鍵盤可能只顯示數字鍵盤,供使用者輸入文字。

名稱說明
0

僅限單行文字欄位。使用下方的 MULTILINE 多行文字。

1

僅限輸入數字的文字欄位。

2

僅限輸入電話號碼的文字欄位 (例如數字、有限的標點符號,或一些驗證)。

3

輸入日期和時間的文字欄位。舉例來說,側邊可以顯示日曆小工具,用來協助輸入日期時間項目。

4

多行文字。

新增日期:8

PointerEventPhase 嚴格

類型:uint32

fuchsia.ui.input/input_events.fidl 中定義

已淘汰:10

名稱說明
0

裝置已開始追蹤指標。

舉例來說,指標可能懸停在裝置上方,但尚未與裝置介面接觸。

1

指標已在未與裝置接觸的情況下移動至裝置。

2

指標已與裝置接觸。

如果是 MOUSE 裝置,當使用者按下主要按鈕以模擬螢幕上的觸控時,就會觸發這項設定。

3

指標已隨著裝置接觸時移動。

4

指標已停止與裝置接觸。

如果是 MOUSE 裝置,會在主要按鈕釋放時觸發。

5

裝置已停止追蹤指標。

舉例來說,指標可能已偏離裝置的懸停偵測範圍,或是與系統完全中斷連線。

6

指標的輸入內容不再導向這個接收器。

PointerEventType 嚴格

類型:uint32

fuchsia.ui.input/input_events.fidl 中定義

已淘汰:10

名稱說明
0

觸控式指標裝置。

1

有觸控筆的指標裝置。

2

指標裝置以及觸控筆反轉。

3

沒有觸控筆的指標裝置。

SensorLocation 彈性

類型:uint32

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

名稱說明
0
1
2

SensorType 彈性

類型:uint32

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13

名稱說明
0
1
2
3

TextAffinity 嚴格

類型:uint32

fuchsia.ui.input/text_editing.fidl 中定義

指定 TextPosition 是在視覺上偏移值上游或下游。

舉例來說,如果文字位置位於換行符號,單一偏移中就會有兩個視覺位置,一個偏移在第一行的斷行前 (第一行結尾) 和行後 (在第二行開始處) 之後。文字相依性會區分這兩種情況。(雙向文字執行之間也會發生類似的情況)。

我們並不需要為這個列舉加入新值。

名稱說明
0

該位置對於文字位置上游側邊的相依性。

舉例來說,如果文字位置的偏移值為換行,位置代表第一行的結尾。

1

該位置對於文字位置下游側邊的相依性。

舉例來說,如果文字位置的偏移值為換行,位置代表第二行的開始位置。

資料表

MediaButtonsEvent

fuchsia.ui.input/input_events.fidl 中定義

序數廣闊類型說明
volume int8
mic_mute bool
pause bool
camera_disable bool
power bool
新增時間:15 張

聯合國

指令:嚴格

定義於 fuchsia.ui.input/commands.fidl

已淘汰:10
序數Variant類型說明
send_keyboard_input SendKeyboardInputCmd
send_pointer_input SendPointerInputCmd
set_hard_keyboard_delivery SetHardKeyboardDeliveryCmd
set_parallel_dispatch SetParallelDispatchCmd

InputEvent strict

fuchsia.ui.input/input_events.fidl 中定義

序數Variant類型說明
pointer PointerEvent
已淘汰:10
keyboard KeyboardEvent
已淘汰:13
focus FocusEvent
已淘汰:10

SensorReport 嚴格

定義於 fuchsia.ui.input/input_reports.fidl

已淘汰:13
序數Variant類型說明
vector int16[3]
scalar uint16

業者

名稱類型說明
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