PROTOCOLS
ImeService
Defined in fuchsia.ui.input/ime_service.fidl
The service provided by an IME
DispatchKey
Request
Name | Type |
---|---|
event |
fuchsia.ui.input2/KeyEvent
|
Response
Name | Type |
---|---|
handled |
bool
|
DispatchKey3
Request
Name | Type |
---|---|
event |
fuchsia.ui.input3/KeyEvent
|
Response
Name | Type |
---|---|
handled |
bool
|
GetInputMethodEditor
Request
Name | Type |
---|---|
keyboard_type |
KeyboardType
|
action |
InputMethodAction
|
initial_state |
TextInputState
|
client |
InputMethodEditorClient
|
editor |
request<InputMethodEditor>
|
HideKeyboard
Request
Name | Type |
---|
InjectInput
Request
Name | Type |
---|---|
event |
InputEvent
|
ShowKeyboard
Request
Name | Type |
---|
ViewFocusChanged
Request
Name | Type |
---|---|
view_ref |
fuchsia.ui.views/ViewRef
|
Response
Name | Type |
---|
ImeVisibilityService
Defined in fuchsia.ui.input/ime_service.fidl
Onscreen keyboard containers connect to this to know when a keyboard should be shown or hidden.
OnKeyboardVisibilityChanged
Response
Name | Type |
---|---|
visible |
bool
|
InputDevice
Defined in fuchsia.ui.input/input_device_registry.fidl
DispatchReport
Dispatch an InputReport
from the device token
Request
Name | Type |
---|---|
report |
InputReport
|
InputDeviceRegistry
Defined in fuchsia.ui.input/input_device_registry.fidl
Service to receive input events.
Input devices can describe their capabilities using DeviceDescriptor
and register themselves with the InputDeviceRegistry
.
RegisterDevice
Register a device with the capabilities described by DeviceDescriptor
Request
Name | Type |
---|---|
descriptor |
DeviceDescriptor
|
input_device |
request<InputDevice>
|
InputMethodEditor
Defined in fuchsia.ui.input/text_input.fidl
A interface for interacting with a text input control.
Hide
Request
Name | Type |
---|
InjectInput
Request
Name | Type |
---|---|
event |
InputEvent
|
SetKeyboardType
Request
Name | Type |
---|---|
keyboard_type |
KeyboardType
|
SetState
Request
Name | Type |
---|---|
state |
TextInputState
|
Show
Request
Name | Type |
---|
InputMethodEditorClient
Defined in fuchsia.ui.input/text_input.fidl
An interface to receive information from TextInputService
.
DidUpdateState
Request
Name | Type |
---|---|
state |
TextInputState
|
event |
InputEvent?
|
OnAction
Request
Name | Type |
---|---|
action |
InputMethodAction
|
PointerCaptureListener
Defined in fuchsia.ui.input/pointer_capture.fidl
A method of obtaining global pointer events, regardless of view focus.
OnPointerEvent
Request
Name | Type |
---|---|
event |
PointerEvent
|
Response
Name | Type |
---|
PointerCaptureListenerRegistry
Defined in fuchsia.ui.input/pointer_capture.fidl
Injects a listener protocol, along with a ViewRef that defines the coordinate space of the captured pointer events.
RegisterListener
This protocol will be subsumed by gesture disambiguation.
Request
Name | Type |
---|---|
listener |
PointerCaptureListener
|
view_ref |
fuchsia.ui.views/ViewRef
|
Response
Name | Type |
---|---|
success |
bool
|
STRUCTS
Axis
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
range |
Range
|
No default | |
resolution |
int32
|
1 | |
scale |
AxisScale
|
AxisScale.LINEAR |
AxisF
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
range |
RangeF
|
No default | |
resolution |
float32
|
1 | |
scale |
AxisScale
|
AxisScale.LINEAR |
DeviceDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
device_info |
DeviceInfo?
|
No default | |
keyboard |
KeyboardDescriptor?
|
No default | |
media_buttons |
MediaButtonsDescriptor?
|
No default | |
mouse |
MouseDescriptor?
|
No default | |
stylus |
StylusDescriptor?
|
No default | |
touchscreen |
TouchscreenDescriptor?
|
No default | |
sensor |
SensorDescriptor?
|
No default |
DeviceInfo
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
vendor_id |
uint32
|
No default | |
product_id |
uint32
|
No default | |
version |
uint32
|
No default | |
name |
string
|
No default |
FocusEvent
Defined in fuchsia.ui.input/input_events.fidl
Name | Type | Description | Default |
---|---|---|---|
event_time |
uint64
|
Time the event was delivered. The time is in nanoseconds and corresponds to the uptime of the machine. |
No default |
focused |
bool
|
Whether the view has gained input focused or not. |
No default |
InputReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
event_time |
uint64
|
No default | |
keyboard |
KeyboardReport?
|
No default | |
media_buttons |
MediaButtonsReport?
|
No default | |
mouse |
MouseReport?
|
No default | |
stylus |
StylusReport?
|
No default | |
touchscreen |
TouchscreenReport?
|
No default | |
sensor |
SensorReport?
|
No default | |
trace_id |
uint64
|
0 |
KeyboardDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
keys |
vector<uint32>
|
No default |
KeyboardEvent
Defined in fuchsia.ui.input/input_events.fidl
KeyboardEvent
represents event generated by a user's interaction with a
keyboard.
Those events are triggered by distinct pressed state changes of the keys.
The state transitions should be as follows: PRESSED -> (REPEAT ->) RELEASED or PRESSED -> (REPEAT ->) CANCELLED
The input system will repeat those events automatically when a code_point is available.
DEPRECATED: Will be removed in favor of fuchsia.ui.input.KeyEvent
.
Name | Type | Description | Default |
---|---|---|---|
event_time |
uint64
|
Time the event was delivered. The time is in nanoseconds and corresponds to the uptime of the machine. |
No default |
device_id |
uint32
|
No default | |
phase |
KeyboardEventPhase
|
No default | |
hid_usage |
uint32
|
Keyboard HID Usage See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf |
No default |
code_point |
uint32
|
The unicode code point represented by this key event, if any. Dead keys are represented as Unicode combining characters. If there is no unicode code point, this value is zero. |
No default |
modifiers |
uint32
|
Key modifiers as defined by the different kModifier constants such as
|
No default |
KeyboardReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
pressed_keys |
vector<uint32>
|
No default |
MediaButtonsDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
buttons |
uint32
|
No default |
MediaButtonsReport
Defined in fuchsia.ui.input/input_reports.fidl
MediaButtonsReport
describes the media buttons event delivered from the event stream.
Each bool in the report represents a single button where true means the button
is being pressed. A single report should be sent on every state change.
Name | Type | Description | Default |
---|---|---|---|
volume_up |
bool
|
No default | |
volume_down |
bool
|
No default | |
mic_mute |
bool
|
No default | |
reset |
bool
|
No default | |
pause |
bool
|
No default | |
camera_disable |
bool
|
No default |
MouseDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
rel_x |
Axis
|
No default | |
rel_y |
Axis
|
No default | |
vscroll |
Axis?
|
No default | |
hscroll |
Axis?
|
No default | |
buttons |
uint32
|
No default |
MouseReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
rel_x |
int32
|
No default | |
rel_y |
int32
|
No default | |
rel_hscroll |
int32
|
No default | |
rel_vscroll |
int32
|
No default | |
pressed_buttons |
uint32
|
No default |
PointerEvent
Defined in fuchsia.ui.input/input_events.fidl
Pointers represent raw data about the user's interaction with the screen.
The state transitions should be as follows: ADD (-> HOVER) -> DOWN -> MOVE -> UP (-> HOVER) -> REMOVE
At any point after the initial ADD, a transition to CANCEL is also possible.
Name | Type | Description | Default |
---|---|---|---|
event_time |
uint64
|
Time the event was delivered. The time is in nanoseconds and corresponds to the uptime of the machine. |
No default |
device_id |
uint32
|
No default | |
pointer_id |
uint32
|
No default | |
type |
PointerEventType
|
No default | |
phase |
PointerEventPhase
|
No default | |
x |
float32
|
|
No default |
y |
float32
|
No default | |
radius_major |
float32
|
0 | |
radius_minor |
float32
|
0 | |
buttons |
uint32
|
Currently pressed buttons as defined the kButton constants such as
|
No default |
Range
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
min |
int32
|
No default | |
max |
int32
|
No default |
RangeF
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
min |
float32
|
No default | |
max |
float32
|
No default |
SendKeyboardInputCmd
Defined in fuchsia.ui.input/commands.fidl
Name | Type | Description | Default |
---|---|---|---|
compositor_id |
uint32
|
No default | |
keyboard_event |
KeyboardEvent
|
No default |
SendPointerInputCmd
Defined in fuchsia.ui.input/commands.fidl
Name | Type | Description | Default |
---|---|---|---|
compositor_id |
uint32
|
No default | |
pointer_event |
PointerEvent
|
No default |
SensorDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
type |
SensorType
|
No default | |
loc |
SensorLocation
|
No default | |
min_sampling_freq |
uint32
|
No default | |
max_sampling_freq |
uint32
|
No default | |
fifo_max_event_count |
uint32
|
No default | |
phys_min |
int32
|
No default | |
phys_max |
int32
|
No default |
SetHardKeyboardDeliveryCmd
Defined in fuchsia.ui.input/commands.fidl
Typically, clients should receive text inputs from an IME.
For cases where no IME mediation is desired (such as a game application), this command requests Scenic to deliver hard keyboard events to the client.
By default, Scenic will not deliver hard keyboard events to a client.
Name | Type | Description | Default |
---|---|---|---|
delivery_request |
bool
|
No default |
SetParallelDispatchCmd
Defined in fuchsia.ui.input/commands.fidl
Obsolete. This command is a no-op.
Name | Type | Description | Default |
---|---|---|---|
parallel_dispatch |
bool
|
No default |
StylusDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
x |
Axis
|
No default | |
y |
Axis
|
No default | |
pressure |
Axis?
|
No default | |
is_invertible |
bool
|
false | |
buttons |
uint32
|
No default |
StylusReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
x |
int32
|
No default | |
y |
int32
|
No default | |
pressure |
uint32
|
No default | |
is_in_contact |
bool
|
No default | |
in_range |
bool
|
No default | |
is_inverted |
bool
|
No default | |
pressed_buttons |
uint32
|
No default |
TextInputState
Defined in fuchsia.ui.input/text_input.fidl
The current text, selection, and composing state for editing a run of text.
Name | Type | Description | Default |
---|---|---|---|
revision |
uint32
|
Current state revision to avoid race conditions. |
No default |
text |
string
|
The current text being edited. |
No default |
selection |
TextSelection
|
The range of text that is currently selected. |
No default |
composing |
TextRange
|
The range of text that is still being composed. |
No default |
TextRange
Defined in fuchsia.ui.input/text_editing.fidl
A range of characters in a string of text. Although strings in FIDL's wire format are UTF-8 encoded, these indices are measured in UTF-16 code units for legacy reasons. These text input APIs will eventually be replaced by fuchsia.ui.text, which uses code points instead.
Name | Type | Description | Default |
---|---|---|---|
start |
int64
|
The index of the first UTF-16 code unit in the range. If |
-1 |
end |
int64
|
The next index after the last UTF-16 code unit in this range. If |
-1 |
TextSelection
Defined in fuchsia.ui.input/text_editing.fidl
A range of text that represents a selection. Although strings in FIDL's wire format are UTF-8 encoded, these indices are measured in UTF-16 code units for legacy reasons. These text input APIs will eventually be replaced by fuchsia.ui.text, which uses code points instead.
Text selection is always directional. Direction should be determined by comparing base and extent.
Name | Type | Description | Default |
---|---|---|---|
base |
int64
|
The offset at which the selection originates, as measured in UTF-16 code units. Might be larger than, smaller than, or equal to extent. |
No default |
extent |
int64
|
The offset at which the selection terminates, as measured in UTF-16 code units. When the user uses the arrow keys to adjust the selection, this is the value that changes. Similarly, if the current theme paints a caret on one side of the selection, this is the location at which to paint the caret. Might be larger than, smaller than, or equal to base. |
No default |
affinity |
TextAffinity
|
If the text range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret. |
No default |
Touch
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
finger_id |
uint32
|
No default | |
x |
int32
|
No default | |
y |
int32
|
No default | |
width |
uint32
|
No default | |
height |
uint32
|
No default |
TouchscreenDescriptor
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
x |
Axis
|
No default | |
y |
Axis
|
No default | |
max_finger_id |
uint32
|
No default |
TouchscreenReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description | Default |
---|---|---|---|
touches |
vector<Touch>
|
No default |
ENUMS
AxisScale
Type: uint32
Defined in fuchsia.ui.input/input_reports.fidl
Name | Value | Description |
---|---|---|
LINEAR |
0 |
|
LOGARITHMIC |
1 |
InputMethodAction
Type: uint32
Defined in fuchsia.ui.input/text_input.fidl
Name | Value | Description |
---|---|---|
UNSPECIFIED |
0 |
|
NONE |
1 |
|
GO |
2 |
|
SEARCH |
3 |
|
SEND |
4 |
|
NEXT |
5 |
|
DONE |
6 |
|
PREVIOUS |
7 |
KeyboardEventPhase
Type: uint32
Defined in fuchsia.ui.input/input_events.fidl
Name | Value | Description |
---|---|---|
PRESSED |
0 |
When key is pressed down. |
RELEASED |
1 |
When key is released. |
CANCELLED |
2 |
This key |
REPEAT |
3 |
Whether this is an automatically generated key repeat |
KeyboardType
Type: uint32
Defined in fuchsia.ui.input/text_input.fidl
Name | Value | Description |
---|---|---|
TEXT |
0 |
|
NUMBER |
1 |
|
PHONE |
2 |
|
DATETIME |
3 |
PointerEventPhase
Type: uint32
Defined in fuchsia.ui.input/input_events.fidl
Name | Value | Description |
---|---|---|
ADD |
0 |
The device has started tracking the pointer. For example, the pointer might be hovering above the device, having not yet made contact with the surface of the device. |
HOVER |
1 |
The pointer has moved with respect to the device while not in contact with the device. |
DOWN |
2 |
The pointer has made contact with the device. For |
MOVE |
3 |
The pointer has moved with respect to the device while in contact with the device. |
UP |
4 |
The pointer has stopped making contact with the device. For |
REMOVE |
5 |
The device is no longer tracking the pointer. For example, the pointer might have drifted out of the device's hover detection range or might have been disconnected from the system entirely. |
CANCEL |
6 |
The input from the pointer is no longer directed towards this receiver. |
PointerEventType
Type: uint32
Defined in fuchsia.ui.input/input_events.fidl
Name | Value | Description |
---|---|---|
TOUCH |
0 |
A touch-based pointer device. |
STYLUS |
1 |
A pointer device with a stylus. |
INVERTED_STYLUS |
2 |
A pointer device with a stylus that has been inverted. |
MOUSE |
3 |
A pointer device without a stylus. |
SensorLocation
Type: uint32
Defined in fuchsia.ui.input/input_reports.fidl
Name | Value | Description |
---|---|---|
UNKNOWN |
0 |
|
BASE |
1 |
|
LID |
2 |
SensorType
Type: uint32
Defined in fuchsia.ui.input/input_reports.fidl
Name | Value | Description |
---|---|---|
ACCELEROMETER |
0 |
|
GYROSCOPE |
1 |
|
MAGNETOMETER |
2 |
|
LIGHTMETER |
3 |
TextAffinity
Type: uint32
Defined in fuchsia.ui.input/text_editing.fidl
Whether a TextPosition is visually upstream or downstream of its offset.
For example, when a text position exists at a line break, a single offset has two visual positions, one prior to the line break (at the end of the first line) and one after the line break (at the start of the second line). A text affinity disambiguates between those cases. (Something similar happens with between runs of bidirectional text.)
Name | Value | Description |
---|---|---|
UPSTREAM |
0 |
The position has affinity for the upstream side of the text position. For example, if the offset of the text position is a line break, the position represents the end of the first line. |
DOWNSTREAM |
1 |
The position has affinity for the downstream side of the text position. For example, if the offset of the text position is a line break, the position represents the start of the second line. |
TABLES
MediaButtonsEvent
Defined in fuchsia.ui.input/input_events.fidl
Ordinal | Name | Type | Description |
---|---|---|---|
1 | volume |
int8
|
|
2 | mic_mute |
bool
|
|
3 | pause |
bool
|
|
4 | camera_disable |
bool
|
UNIONS
Command
Defined in fuchsia.ui.input/commands.fidl
Name | Type | Description |
---|---|---|
send_keyboard_input |
SendKeyboardInputCmd
|
Commands for conveying input events to a |
send_pointer_input |
SendPointerInputCmd
|
|
set_hard_keyboard_delivery |
SetHardKeyboardDeliveryCmd
|
Command to enable/disable delivery of hard keyboard events. |
set_parallel_dispatch |
SetParallelDispatchCmd
|
Obsolete. This command is a no-op. |
InputEvent
Defined in fuchsia.ui.input/input_events.fidl
This union does not include MediaButtonsEvent because it's processed differently.
Name | Type | Description |
---|---|---|
pointer |
PointerEvent
|
|
keyboard |
KeyboardEvent
|
|
focus |
FocusEvent
|
SensorReport
Defined in fuchsia.ui.input/input_reports.fidl
Name | Type | Description |
---|---|---|
vector |
int16[3]
|
|
scalar |
uint16
|
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
kCameraDisable |
32
|
uint32 |
|
kMicMute |
4
|
uint32 |
|
kModifierAlt |
96
|
uint32 |
|
kModifierCapsLock |
1
|
uint32 |
|
kModifierControl |
24
|
uint32 |
|
kModifierLeftAlt |
32
|
uint32 |
|
kModifierLeftControl |
8
|
uint32 |
|
kModifierLeftShift |
2
|
uint32 |
|
kModifierLeftSuper |
128
|
uint32 |
|
kModifierNone |
0
|
uint32 |
Keyboard modifiers |
kModifierRightAlt |
64
|
uint32 |
|
kModifierRightControl |
16
|
uint32 |
|
kModifierRightShift |
4
|
uint32 |
|
kModifierRightSuper |
256
|
uint32 |
|
kModifierShift |
6
|
uint32 |
|
kModifierSuper |
384
|
uint32 |
|
kMouseButtonPrimary |
1
|
uint32 |
Common mouse buttons report constants |
kMouseButtonSecondary |
2
|
uint32 |
|
kMouseButtonTertiary |
4
|
uint32 |
|
kMousePrimaryButton |
1
|
uint32 |
Mouse buttons |
kMouseSecondaryButton |
2
|
uint32 |
|
kMouseTertiaryButton |
4
|
uint32 |
|
kPause |
16
|
uint32 |
|
kReset |
8
|
uint32 |
|
kStylusBarrel |
1
|
uint32 |
Common stylus buttons report constants |
kStylusPrimaryButton |
1
|
uint32 |
Stylus buttons |
kStylusSecondaryButton |
2
|
uint32 |
|
kVolumeDown |
2
|
uint32 |
|
kVolumeUp |
1
|
uint32 |
Used as mask bits (2^N) against ButtonDescriptor.buttons. |