fuchsia.input.report

Added: 7

PROTOCOLS

InputDevice

Defined in fuchsia.input.report/device.fidl

An InputDevice driver represents a single physical input device. The InputDevice maintains an internal FIFO of MAX_DEVICE_REPORT_COUNT reports for each client that connects. Reports are removed from the FIFO once they are read by the client. If the FIFO is full, it will drop the oldest report to make room for an incoming report.

GetDescriptor

Gets the device descriptor for this device.

Request

<EMPTY>

Response

NameType
descriptor DeviceDescriptor

GetFeatureReport

Get the feature report for a given device. This requests the state of the device's features.

Request

<EMPTY>

Response

NameType
payload InputDevice_GetFeatureReport_Result

GetInputReport

For general cases, InputReportReader is the preferred way of getting InputReports. For devices that don't send InputReports naturally, this method can be used to request a report from the device type indicated. Does not block, and returns ZX_ERR_NOT_SUPPORTED if GetInputReport or device_type are not supported.

Request

NameType
device_type DeviceType

Response

NameType
payload InputDevice_GetInputReport_Result

GetInputReportsReader

Open a new InputReportsReader on this device. Each reader receives their own reports.

Request

NameType
reader server_end:InputReportsReader

SendOutputReport

Send a single output report to the device. This will throw an error if the output report does not follow the OutputDescriptor.

Request

NameType
report OutputReport

Response

NameType
payload InputDevice_SendOutputReport_Result

SetFeatureReport

Set the feature report for a given device. This sets the state of the device's features.

Request

NameType
report FeatureReport

Response

NameType
payload InputDevice_SetFeatureReport_Result

InputReportsReader

Defined in fuchsia.input.report/device.fidl

Each InputReportsReader has its own FIFO of InputReports that it maintains. When ReadInputReports is called it drains the InputReports FIFO. If too many InputReports are created before the FIFO is drained, then the oldest InputReport will be silently discarded.

ReadInputReports

This is a Hanging-Get function to read the reports in the InputReport FIFO. This will not reply until there is at least one report available. If there is already one outstanding Hanging-Get, calling this again will return ZX_ERR_ALREADY_BOUND.

Request

<EMPTY>

Response

NameType
payload InputReportsReader_ReadInputReports_Result

STRUCTS

Axis

Defined in fuchsia.input.report/units.fidl

An Axis is defined as a range and a unit.

FieldTypeDescriptionDefault
range Range No default
unit Unit No default

DeviceInfo

Defined in fuchsia.input.report/descriptor.fidl

DeviceInfo provides more information about the device and lets a client distinguish between devices (e.g between two touchscreens that come from different vendors). If the device is a HID device, then the id information will come from the device itself. Other, non-HID devices may assign the ids in the driver, so it will be the driver author's responsibility to assign sensible ids.

Removed: 20

FieldTypeDescriptionDefault
vendor_id uint32 No default
product_id uint32 No default
version uint32 No default

InputDevice_GetFeatureReport_Response

Defined in fuchsia.input.report/device.fidl

FieldTypeDescriptionDefault
report FeatureReport No default

InputDevice_GetInputReport_Response

Defined in fuchsia.input.report/device.fidl

FieldTypeDescriptionDefault
report InputReport No default

InputDevice_SendOutputReport_Response

Defined in fuchsia.input.report/device.fidl

<EMPTY>

InputDevice_SetFeatureReport_Response

Defined in fuchsia.input.report/device.fidl

<EMPTY>

InputReportsReader_ReadInputReports_Response

Defined in fuchsia.input.report/device.fidl

FieldTypeDescriptionDefault
reports vector<InputReport>:50 No default

Range

Defined in fuchsia.input.report/units.fidl

Describe a Range of values.

FieldTypeDescriptionDefault
min int64 No default
max int64 No default

SensorAxis

Defined in fuchsia.input.report/sensor.fidl

A SensorAxis is a normal Axis with an additional SensorType to describe what the axis is measuring.

FieldTypeDescriptionDefault
axis Axis No default
type SensorType No default

Unit

Defined in fuchsia.input.report/units.fidl

Describes a given unit by giving the unit and the unit's exponent. E.g: Nanometers would have type METERS and exponent -9.

FieldTypeDescriptionDefault
type UnitType No default
exponent int32 No default

ENUMS

ConsumerControlButton flexible

Type: uint32

Defined in fuchsia.input.report/consumer_control.fidl

These ControlButtons represent on/off buttons whose purpose is to change the host's configuration.

NameValueDescription
1

This button represents increasing volume.

2

This button represents decreasing volume.

3

This button represents pausing.

4

This button represents factory resetting the host.

5

This button represents muting the microphone on the host.

6

This button represents rebooting the host.

7

This button represents disabling the camera on the host.

8

This button represents a function.

Added: 24
9

This button represents a power button.

Added: 24

DeviceType flexible

Type: uint32

Defined in fuchsia.input.report/device.fidl

The InputReport field to be populated by InputDevice.GetInputReport.

NameValueDescription
0
1
2
3
4

LedType flexible

Type: uint32

Defined in fuchsia.input.report/led.fidl

An LedType represents an LED on a device that can be turned on or off. When applicable, the definition of each LED is derived from one of the following sources albeit with a Fuchsia-specific numeric value:

  • USB HID usage codes for usage page 0x0008 (LED)

NameValueDescription
1

LED to indicate a Keyboard's number lock is enabled. Corresponds to USB HID page 0x0008 usage 0x0001

2

LED to indicate a Keyboard's capital lock is enabled. Corresponds to USB HID page 0x0008 usage 0x0002

3

LED to indicate a Keyboard's scroll lock is enabled. Corresponds to USB HID page 0x0008 usage 0x0003

4

LED to indicate a Keyboard's composition mode is enabled. Corresponds to USB HID page 0x0008 usage 0x0004

5

LED to indicate a Keyboard's Kana mode is enabled. Corresponds to USB HID page 0x0008 usage 0x0005

SensorReportingState flexible

Type: uint32

Defined in fuchsia.input.report/sensor.fidl

SensorReportingState determines when a sensor will send reports.

NameValueDescription
1

No events will be sent from the sensor.

2

All events will be sent from the sensor. For most sensors, this frequency can be set by report_interval.

3

Only events that cross a threshold will be reported.

SensorType flexible

Type: uint32

Defined in fuchsia.input.report/sensor.fidl

Each sensor value has a corresponding SensorType, which explains what the value is measuring in the world.

NameValueDescription
1

Acceleration on the X axis.

2

Acceleration on the Y axis.

3

Acceleration on the Z axis.

4

Strength of the Magnetic Field in the X axis.

5

Strength of the Magnetic Field in the Y axis.

6

Strength of the Magnetic Field in the Z axis.

7

Angular Velocity in the X direction moving counter-clockwise.

8

Angular Velocity in the Y direction moving counter-clockwise.

9

Angular Velocity in the Z direction moving counter-clockwise.

10

Ambient level of Light.

11

Ambient level of Red Light.

12

Ambient level of Green Light.

13

Ambient level of Blue Light.

TouchConfigurationInputMode flexible

Type: uint32

Defined in fuchsia.input.report/touch.fidl

Input mode indicating which top-level collection should be used for input reporting. These values must correspond to the input modes defined in 16.7 of the HID Usage Tables for Universal Serial Bus (USB) Spec (https://usb.org/sites/default/files/hut1_22.pdf).

NameValueDescription
0

Use the Mouse Collection for reporting data.

3

Use the Windows Precision Touchpad Collection for reporting data. Defined by Windows Precision Touchpad Required HID Top-Level Collections: https://docs.microsoft.com/ en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required -hid-top-level-collections).

TouchType flexible

Type: uint32

Defined in fuchsia.input.report/touch.fidl

The device type from which the touch originated.

NameValueDescription
1

A touch screen has direct finger input associated with a display.

2

A touch pad is a pointer device that tracks finger positions.

UnitType flexible

Type: uint32

Defined in fuchsia.input.report/units.fidl

This provides an easy, standardized way to specify units. New units can be added as needed. Each UnitType should be named after a specific unit that should be fully distinguished by the name (E.g: Use METERS instead of DISTANCE). More complicated units that need to be differentiated should begin with SI_ (for Internation System of Units) or ENGLISH_ (for English System of Units).

NameValueDescription
0

The device did not specify units.

1

The device specified units that are not convertible to any of the other units.

2

A measurement of distance in meters.

3

A measurement of mass in grams.

4

A measurement of rotation in degrees.

5

A measurement of angular velocity in degrees per second.

6

A measurement of linear velocity in meters per second.

7

A measurement of acceleration in meters per second squared.

8

A measure of magnetic flux in webers.

9

A measurement of luminous intensity in candelas.

10

A measurement of pressure in pascals.

11
12

VendorGoogleProductId flexible

Type: uint32

Defined in fuchsia.input.report/device_ids.fidl

Below are ProductIds which represents which product this Input device represents. If the Input device is a HID device, the ProductId maps directly to the HID ProductId. If the Input device is not a HID device, then the ProductId will be greater than 0xFFFF, which is the max HID ProductId.

NameValueDescription
65537

Below are the non-HID VendorIds

65538
65539
65540
65541
Added: HEAD
65542
Added: HEAD
65543
Added: HEAD
65544
Added: HEAD
65545
Added: HEAD
65546
Added: HEAD
2417819649
2417819650
2417819651

VendorId flexible

Type: uint32

Defined in fuchsia.input.report/device_ids.fidl

The VendorId represents the vendor that created this Input device. If the Input device is a HID device, the VendorId maps directly to the HID VendorId. If the Input device is not a HID device, then the VendorId will be greater than 0xFFFF, which is the max HID VendorId.

NameValueDescription
6353

Below are the HID VendorIds, range 0x0000 - 0xFFFF.

TABLES

ConsumerControlDescriptor

Defined in fuchsia.input.report/consumer_control.fidl

A Fuchsia ConsumerControl represents a device thats purpose is to change values on the host. Typical controls are Volume, Power, Media Playback. (Consider a TV remote to be a typical ConsumerControl).

OrdinalFieldTypeDescription
input ConsumerControlInputDescriptor

ConsumerControlInputDescriptor

Defined in fuchsia.input.report/consumer_control.fidl

Describes the format of the input report that will be sent from the ConsumerControl device to the host.

OrdinalFieldTypeDescription
buttons vector<ConsumerControlButton>:255

The list of buttons that this device contains.

ConsumerControlInputReport

Defined in fuchsia.input.report/consumer_control.fidl

A single report created by a ConsumerControl device.

OrdinalFieldTypeDescription
pressed_buttons vector<ConsumerControlButton>:255

The list of buttons that are currently pressed down.

ContactInputDescriptor

Defined in fuchsia.input.report/touch.fidl

ContactInputDescriptor describes the fields associated with a touch on a touch device.

OrdinalFieldTypeDescription
position_x Axis

Describes the reporting of the x-axis.

position_y Axis

Describes the reporting of the y-axis.

pressure Axis

Pressure of the contact.

contact_width Axis

Width of the area of contact.

contact_height Axis

Height of the area of contact.

ContactInputReport

Defined in fuchsia.input.report/touch.fidl

ContactInputReport describes one touch on a touch device.

OrdinalFieldTypeDescription
contact_id uint32

Identifier for this contact.

position_x int64

A contact's position on the x axis.

position_y int64

A contact's position on the y axis.

pressure int64

Pressure of the contact.

contact_width int64

Width of the bounding box around the touch contact. Combined with contact_height, this describes the area of the touch contact. contact_width and contact_height should both have units of distance, and they should be in the same units as position_x and position_y.

contact_height int64

Height of the bounding box around the touch contact. Combined with contact_width, this describes the area of the touch contact. contact_width and contact_height should both have units of distance, and they should be in the same units as position_x and position_y.

confidence bool

Also known as touch valid. Indicates the device’s confidence that the touch contact was an intended, valid contact. The device should report 0 if the contact is not a valid touch. The device should report 1 if the contact is intended and valid (e.g. a pointing touch)

Added: 9

DeviceDescriptor

Defined in fuchsia.input.report/descriptor.fidl

DeviceDescriptor describes a physical input device. Some physical devices may send multiple types of reports (E.g: a physical touchscreen can send touch and stylus reports, so it will have both a TouchDescriptor and a StylusDescriptor).

OrdinalFieldTypeDescription
device_info DeviceInfo

This field is removed. Use device_information instead.

Removed: 20
mouse MouseDescriptor

When mouse is present the device has a mouse.

sensor SensorDescriptor

When sensor is present the device has a sensor.

touch TouchDescriptor

When touch is present the device has a touch device. (E.g: Touchscreen, touchpad).

keyboard KeyboardDescriptor

When keyboard is present the device has a keyboard.

consumer_control ConsumerControlDescriptor

When consumer_control is present the device has a ConsumerControl device.

device_information DeviceInformation

device_information should always be present to help distinguish between physical devices.

Added: 20

DeviceInformation

Defined in fuchsia.input.report/descriptor.fidl

DeviceInformation provides more information about the device and lets a client distinguish between devices (e.g between two touchscreens that come from different vendors). If the device is a HID device, then the id information will come from the device itself. Other, non-HID devices may assign the ids in the driver, so it will be the driver author's responsibility to assign sensible ids.

Added: 20

OrdinalFieldTypeDescription
vendor_id uint32
product_id uint32
version uint32
polling_rate zx/Duration

FeatureReport

Defined in fuchsia.input.report/report.fidl

A single report containing the feature information for an input device. Feature reports obtained from the device show the current state of the device. Sending a feature report to the device sets the device in that state.

OrdinalFieldTypeDescription
sensor SensorFeatureReport
touch TouchFeatureReport

InputReport

Defined in fuchsia.input.report/report.fidl

InputReport is a single report that is created by an input device.

OrdinalFieldTypeDescription
event_time zx/Time

event_time is in nanoseconds when the event was recorded.

mouse MouseInputReport

mouse is the report generated if the device contains a mouse.

trace_id uint64

Unique ID to connect trace async begin/end events.

sensor SensorInputReport

sensor is the report generated if the device contains a sensor.

touch TouchInputReport

touch is the report generated if the device contains a touch device.

keyboard KeyboardInputReport

keyboard is the report generated if the device contains a keyboard.

consumer_control ConsumerControlInputReport

consumer_controls is the report generated if the device contains a ConsumerControl device.

report_id uint8

The Descriptor that describes this InputReport will have a matching ReportID. If this doesn't exist, report_id is 0.

KeyboardDescriptor

Defined in fuchsia.input.report/keyboard.fidl

The capabilities of a keyboard device.

OrdinalFieldTypeDescription
input KeyboardInputDescriptor
output KeyboardOutputDescriptor

KeyboardInputDescriptor

Defined in fuchsia.input.report/keyboard.fidl

Describes the format of the input report that will be sent from the keyboard to the device.

OrdinalFieldTypeDescription
keys3 vector<fuchsia.input/Key>:256

The list of keys that this keyboard contains.

KeyboardInputReport

Defined in fuchsia.input.report/keyboard.fidl

A single report created by a keyboard device.

OrdinalFieldTypeDescription
pressed_keys3 vector<fuchsia.input/Key>:256

The list of keys that are currently pressed down.

KeyboardOutputDescriptor

Defined in fuchsia.input.report/keyboard.fidl

Describes the format of the output report that can be sent to the keyboard..

OrdinalFieldTypeDescription
leds vector<LedType>:256

The list of keyboard LEDs that can be toggled.

KeyboardOutputReport

Defined in fuchsia.input.report/keyboard.fidl

A single report containing output information for a keyboard.

OrdinalFieldTypeDescription
enabled_leds vector<LedType>:256

Each LED in this list will be turned on. Any LED not in this list will be turned off.

MouseDescriptor

Defined in fuchsia.input.report/mouse.fidl

The capabilities of a mouse device.

OrdinalFieldTypeDescription
input MouseInputDescriptor

MouseInputDescriptor

Defined in fuchsia.input.report/mouse.fidl

Describes the format of the input report that will be sent from the mouse to the device.

OrdinalFieldTypeDescription
movement_x Axis

The range of relative X movement.

movement_y Axis

The range of relative Y movement.

scroll_v Axis

The range of relative vertical scroll.

scroll_h Axis

The range of relative horizontal scroll.

buttons vector<uint8>:32

This is a vector of ids for the mouse buttons.

position_x Axis

The range of the position of X. The main use of position is from virtual mice like over VNC.

position_y Axis

The range of the position of Y. The main use of position is from virtual mice like over VNC.

MouseInputReport

Defined in fuchsia.input.report/mouse.fidl

MouseReport gives the relative movement of the mouse and currently pressed buttons. Relative means the movement seen between the previous report and this report. The client is responsible for tracking this and converting it to absolute movement.

OrdinalFieldTypeDescription
movement_x int64

Relative X positional displacement.

movement_y int64

Relative Y positional displacement.

scroll_v int64

Relative vertical scrolling displacement.

scroll_h int64

Relative horizontal scrolling displacement.

pressed_buttons vector<uint8>:32

A list of currently pressed buttons.

position_x int64

The position of X. The main use of position is from virtual mice like over VNC.

position_y int64

The position of Y. The main use of position is from virtual mice like over VNC.

OutputDescriptor

Defined in fuchsia.input.report/descriptor.fidl

Describes the output reports that a physical input device will accept. Output information typically represents device output to the user (E.g: LEDs, tactile feedback, etc).

OrdinalFieldTypeDescription
keyboard KeyboardOutputDescriptor

OutputReport

Defined in fuchsia.input.report/report.fidl

A single report containing output information for an input device. Output information typically represents device output to the user (E.g: LEDs, tactile feedback, etc).

OrdinalFieldTypeDescription
keyboard KeyboardOutputReport

SelectiveReportingFeatureReport

Defined in fuchsia.input.report/touch.fidl

Selective Reporting Feature Report indicating which types of input are reported.

OrdinalFieldTypeDescription
surface_switch bool

If this is true, the device will report surface contacts.

button_switch bool

If this is true, the device will report button state.

SensorDescriptor

Defined in fuchsia.input.report/sensor.fidl

The capabilities of a sensor device.

OrdinalFieldTypeDescription
input vector<SensorInputDescriptor>:255
feature vector<SensorFeatureDescriptor>:255

SensorFeatureDescriptor

Defined in fuchsia.input.report/sensor.fidl

Describes the format of the sensor's feature report. Feature reports can be requested from the sensor, or sent to the sensor.

OrdinalFieldTypeDescription
report_interval Axis

Describes the minimum and maximum reporting interval this sensor supports.

sensitivity vector<SensorAxis>:100

Sets the sensitivity for the given SensorType.

supports_reporting_state bool

If this is true then SensorFeatureReport supports setting a SensorReportingState.

threshold_high vector<SensorAxis>:100

Sets the high threshold values for the given SensorType.

threshold_low vector<SensorAxis>:100

Sets the low threshold values for the given SensorType.

sampling_rate Axis

Describes the minimum and maximum sampling rate this sensor supports.

report_id uint8

ReportID of current descriptor. Report with same report ID should be associated with this descriptor.

SensorFeatureReport

Defined in fuchsia.input.report/sensor.fidl

A SensorFeatureReport describes the features of a given sensor. If a FeatureReport is sent to the Input Device it sets the configuration of the device. If a FeatureReport is requested from the Input Device it shows the device's current configuration.

OrdinalFieldTypeDescription
report_interval int64

The time between reports sent by the sensor.

sensitivity vector<int64>:100

The sensitivity for various SensorType. This vector must be given in the order of the descriptor's sensitivity vector.

reporting_state SensorReportingState

This determines when the sensor will send reports.

threshold_high vector<int64>:100

The high thresholds for various SensorType. This vector must be given in the order of the descriptor's threshold_high vector.

threshold_low vector<int64>:100

The low thresholds for various SensorType. This vector must be given in the order of the descriptor's threshold_low vector.

sampling_rate int64

The rate at which the sensor is sampled.

SensorInputDescriptor

Defined in fuchsia.input.report/sensor.fidl

Describes the format of the input report that will be sent from the sensor to the device.

OrdinalFieldTypeDescription
values vector<SensorAxis>:100

Each SensorAxis in values describes what a sensor is measuring and its range. These will directly correspond to the values in SensorReport.

report_id uint8

ReportID of current descriptor. Report with same report ID should be associated with this descriptor.

SensorInputReport

Defined in fuchsia.input.report/sensor.fidl

SensorReport gives the values measured by a sensor at a given point in time.

OrdinalFieldTypeDescription
values vector<int64>:100

The ordering of values will always directly correspond to the ordering of the values in SensorDescriptor.

TouchDescriptor

Defined in fuchsia.input.report/touch.fidl

The capabilities of a touch device.

OrdinalFieldTypeDescription
input TouchInputDescriptor
feature TouchFeatureDescriptor

TouchFeatureDescriptor

Defined in fuchsia.input.report/touch.fidl

Describes the format of the touchpad configuration's feature report. Feature reports can be requested from the touchpad, or sent to the touchpad.

OrdinalFieldTypeDescription
supports_input_mode bool

Indicates whether or not touch feature descriptor supports different input modes.

supports_selective_reporting bool

Indicates whether or not touch feature descriptor supports selective reporting.

TouchFeatureReport

Defined in fuchsia.input.report/touch.fidl

A TouchFeatureReport describes the features of a given touch device. If a FeatureReport is sent to the Input Device it sets the configuration of the device. If a FeatureReport is requested from the Input Device it shows the device's current configuration.

OrdinalFieldTypeDescription
input_mode TouchConfigurationInputMode

The input mode currently reporting.

selective_reporting SelectiveReportingFeatureReport

The current report types being reported.

TouchInputDescriptor

Defined in fuchsia.input.report/touch.fidl

Describes the format of the input report that will be sent from the keyboard to the device.

OrdinalFieldTypeDescription
contacts vector<ContactInputDescriptor>:10

The contact descriptors associated with this touch descriptor.

max_contacts uint32

The max number of contacts that this touch device can report at once.

touch_type TouchType

The type of touch device being used.

buttons vector<uint8>:10

Identifiers for the physical buttons on a touch device.

TouchInputReport

Defined in fuchsia.input.report/touch.fidl

TouchInputReport describes the current contacts recorded by the touchscreen.

OrdinalFieldTypeDescription
contacts vector<ContactInputReport>:10

The contacts currently being reported by the device.

pressed_buttons vector<uint8>:10

Identifiers for currently pressed buttons.

UNIONS

InputDevice_GetFeatureReport_Result strict

Defined in fuchsia.input.report/device.fidl

OrdinalVariantTypeDescription
response InputDevice_GetFeatureReport_Response
err zx/Status

InputDevice_GetInputReport_Result strict

Defined in fuchsia.input.report/device.fidl

OrdinalVariantTypeDescription
response InputDevice_GetInputReport_Response
err zx/Status

InputDevice_SendOutputReport_Result strict

Defined in fuchsia.input.report/device.fidl

OrdinalVariantTypeDescription
response InputDevice_SendOutputReport_Response
err zx/Status

InputDevice_SetFeatureReport_Result strict

Defined in fuchsia.input.report/device.fidl

OrdinalVariantTypeDescription
response InputDevice_SetFeatureReport_Response
err zx/Status

InputReportsReader_ReadInputReports_Result strict

Defined in fuchsia.input.report/device.fidl

OrdinalVariantTypeDescription
response InputReportsReader_ReadInputReports_Response
err zx/Status

CONSTANTS

NameValueTypeDescription
CONSUMER_CONTROL_MAX_NUM_BUTTONS 255 uint32

Hardcoded max sizes for ConsumerControl vectors. These sizes should be increased if we ever see a device with more objects than can be represented.

KEYBOARD_MAX_NUM_KEYS 256 uint32

Hardcoded max sizes for keyboard vectors. These sizes should be increased if we ever see keyboards with more objects than can be represented.

KEYBOARD_MAX_NUM_LEDS 256 uint32
KEYBOARD_MAX_PRESSED_KEYS 256 uint32
MAX_DEVICE_REPORT_COUNT 50 uint32
MAX_REPORT_COUNT 255 uint32

A hardcoded number of max reports. Because report ID is only 8 bits, only 255 different reports are allowed at a time.

MOUSE_MAX_NUM_BUTTONS 32 uint32

A hardcoded number of max mouse buttons. This should be increased in the future if we ever see mice with more buttons.

SENSOR_MAX_VALUES 100 uint32

A hardcoded number of max sensor values. This should be increased in the future if we ever see a sensor with more values.

TOUCH_MAX_CONTACTS 10 uint32

A hardcoded number of max contacts per report. This should be increased in the future if we see devices with more than the max amount.

TOUCH_MAX_NUM_BUTTONS 10 uint32