Google is committed to advancing racial equity for Black communities. See how.

fuchsia.input.report

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

NameType

Response

NameType
descriptor DeviceDescriptor

GetFeatureReport

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

Request

NameType

Response

NameType
result InputDevice_GetFeatureReport_Result

GetInputReportsReader

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

Request

NameType
reader request<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
result 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
result 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

NameType

Response

NameType
result InputReportsReader_ReadInputReports_Result

STRUCTS

Axis

Defined in fuchsia.input.report/units.fidl

An Axis is defined as a range and a unit.

NameTypeDescriptionDefault
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.

NameTypeDescriptionDefault
vendor_id uint32 No default
product_id uint32 No default
version uint32 No default

InputDevice_GetFeatureReport_Response

Defined in fuchsia.input.report/device.fidl

NameTypeDescriptionDefault
report FeatureReport No default

InputDevice_SendOutputReport_Response

Defined in fuchsia.input.report/device.fidl

NameTypeDescriptionDefault

InputDevice_SetFeatureReport_Response

Defined in fuchsia.input.report/device.fidl

NameTypeDescriptionDefault

InputReportsReader_ReadInputReports_Response

Defined in fuchsia.input.report/device.fidl

NameTypeDescriptionDefault
reports vector<InputReport>[50] No default

Range

Defined in fuchsia.input.report/units.fidl

Describe a Range of values.

NameTypeDescriptionDefault
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.

NameTypeDescriptionDefault
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.

NameTypeDescriptionDefault
type UnitType No default
exponent int32 No default

ENUMS

ConsumerControlButton

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
VOLUME_UP 1

This button represents increasing volume.

VOLUME_DOWN 2

This button represents decreasing volume.

PAUSE 3

This button represents pausing.

FACTORY_RESET 4

This button represents factory resetting the host.

MIC_MUTE 5

This button represents muting the microphone on the host.

REBOOT 6

This button represents rebooting the host.

CAMERA_DISABLE 7

This button represents disabling the camera on the host.

LedType

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
NUM_LOCK 1

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

CAPS_LOCK 2

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

SCROLL_LOCK 3

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

COMPOSE 4

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

KANA 5

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

SensorReportingState

Type: uint32

Defined in fuchsia.input.report/sensor.fidl

SensorReportingState determines when a sensor will send reports.

NameValueDescription
REPORT_NO_EVENTS 1

No events will be sent from the sensor.

REPORT_ALL_EVENTS 2

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

REPORT_THRESHOLD_EVENTS 3

Only events that cross a threshold will be reported.

SensorType

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
ACCELEROMETER_X 1

Acceleration on the X axis.

ACCELEROMETER_Y 2

Acceleration on the Y axis.

ACCELEROMETER_Z 3

Acceleration on the Z axis.

MAGNETOMETER_X 4

Strength of the Magnetic Field in the X axis.

MAGNETOMETER_Y 5

Strength of the Magnetic Field in the Y axis.

MAGNETOMETER_Z 6

Strength of the Magnetic Field in the Z axis.

GYROSCOPE_X 7

Angular Velocity in the X direction moving counter-clockwise.

GYROSCOPE_Y 8

Angular Velocity in the Y direction moving counter-clockwise.

GYROSCOPE_Z 9

Angular Velocity in the Z direction moving counter-clockwise.

LIGHT_ILLUMINANCE 10

Ambient level of Light.

LIGHT_RED 11

Ambient level of Red Light.

LIGHT_GREEN 12

Ambient level of Green Light.

LIGHT_BLUE 13

Ambient level of Blue Light.

TouchType

Type: uint32

Defined in fuchsia.input.report/touch.fidl

The device type from which the touch originated.

NameValueDescription
TOUCHSCREEN 1

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

TOUCHPAD 2

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

UnitType

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
NONE 0

The device did not specify units.

OTHER 1

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

METERS 2

A measurement of distance in meters.

GRAMS 3

A measurement of mass in grams.

DEGREES 4

A measurement of rotation in degrees.

ENGLISH_ANGULAR_VELOCITY 5

A measurement of angular velocity in degrees per second.

SI_LINEAR_VELOCITY 6

A measurement of linear velocity in meters per second.

SI_LINEAR_ACCELERATION 7

A measurement of acceleration in meters per second squared.

WEBERS 8

A measure of magnetic flux in webers.

CANDELAS 9

A measurement of luminous intensity in candelas.

PASCALS 10

A measurement of pressure in pascals.

LUX 11
SECONDS 12

VendorGoogleProductId

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
FOCALTECH_TOUCHSCREEN 65537

Below are the non-HID VendorIds

AMS_LIGHT_SENSOR 65538

VendorId

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
GOOGLE 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).

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 position_x Axis

Describes the reporting of the x-axis.

2 position_y Axis

Describes the reporting of the y-axis.

3 pressure Axis

Pressure of the contact.

4 contact_width Axis

Width of the area of contact.

5 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.

OrdinalNameTypeDescription
1 contact_id uint32

Identifier for this contact.

2 position_x int64

A contact's position on the x axis.

3 position_y int64

A contact's position on the y axis.

4 pressure int64

Pressure of the contact.

5 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.

6 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.

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).

OrdinalNameTypeDescription
1 device_info DeviceInfo

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

2 mouse MouseDescriptor

When mouse is present the device has a mouse.

3 sensor SensorDescriptor

When sensor is present the device has a sensor.

4 touch TouchDescriptor

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

5 keyboard KeyboardDescriptor

When keyboard is present the device has a keyboard.

6 consumer_control ConsumerControlDescriptor

When consumer_control is present the device has a ConsumerControl device.

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.

OrdinalNameTypeDescription
1 sensor SensorFeatureReport

InputReport

Defined in fuchsia.input.report/report.fidl

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

OrdinalNameTypeDescription
1 event_time zx/time

event_time is in nanoseconds when the event was recorded.

2 mouse MouseInputReport

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

4 sensor SensorInputReport

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

5 touch TouchInputReport

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

6 keyboard KeyboardInputReport

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

7 consumer_control ConsumerControlInputReport

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

3 trace_id uint64

Unique ID to connect trace async begin/end events.

KeyboardDescriptor

Defined in fuchsia.input.report/keyboard.fidl

The capabilities of a keyboard device.

OrdinalNameTypeDescription
1 input KeyboardInputDescriptor
2 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.

OrdinalNameTypeDescription
1 keys vector<fuchsia.ui.input2/Key>[256]

The list of keys that this keyboard contains. Deprecated: in process of migration to input3.

2 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.

OrdinalNameTypeDescription
1 pressed_keys vector<fuchsia.ui.input2/Key>[256]

The list of keys that are currently pressed down. Deprecated: in process of migration to input3.

2 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..

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 movement_x Axis

The range of relative X movement.

2 movement_y Axis

The range of relative Y movement.

6 position_x Axis

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

7 position_y Axis

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

3 scroll_v Axis

The range of relative vertical scroll.

4 scroll_h Axis

The range of relative horizontal scroll.

5 buttons vector<uint8>[32]

This is a vector of id's for the mouse buttons.

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.

OrdinalNameTypeDescription
1 movement_x int64

Relative X positional displacement.

2 movement_y int64

Relative Y positional displacement.

6 position_x int64

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

7 position_y int64

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

3 scroll_v int64

Relative vertical scrolling displacement.

4 scroll_h int64

Relative horizontal scrolling displacement.

5 pressed_buttons vector<uint8>[32]

A list of currently pressed buttons.

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).

OrdinalNameTypeDescription
1 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).

OrdinalNameTypeDescription
1 keyboard KeyboardOutputReport

SensorDescriptor

Defined in fuchsia.input.report/sensor.fidl

The capabilities of a sensor device.

OrdinalNameTypeDescription
1 input SensorInputDescriptor
2 feature SensorFeatureDescriptor

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.

OrdinalNameTypeDescription
1 report_interval Axis

Describes the minimum and maximum reporting interval this sensor supports.

3 supports_reporting_state bool

If this is true then SensorFeatureReport supports setting a SensorReportingState.

2 sensitivity vector<SensorAxis>[100]

Sets the sensitivity for the given SensorType.

4 threshold_high vector<SensorAxis>[100]

Sets the high threshold values for the given SensorType.

5 threshold_low vector<SensorAxis>[100]

Sets the low threshold values for the given SensorType.

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.

OrdinalNameTypeDescription
1 report_interval int64

The time between reports sent by the sensor.

3 reporting_state SensorReportingState

This determines when the sensor will send reports.

2 sensitivity vector<int64>[100]

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

4 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.

5 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.

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.

OrdinalNameTypeDescription
1 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.

SensorInputReport

Defined in fuchsia.input.report/sensor.fidl

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

OrdinalNameTypeDescription
1 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.

OrdinalNameTypeDescription
1 input TouchInputDescriptor

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.

OrdinalNameTypeDescription
1 contacts vector<ContactInputDescriptor>[10]

The contact descriptors associated with this touch descriptor.

2 max_contacts uint32

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

3 touch_type TouchType

The type of touch device being used.

4 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.

OrdinalNameTypeDescription
1 contacts vector<ContactInputReport>[10]

The contacts currently being reported by the device.

2 pressed_buttons vector<uint8>[10]

Identifiers for currently pressed buttons.

UNIONS

InputDevice_GetFeatureReport_Result

Defined in fuchsia.input.report/device.fidl

NameTypeDescription
response InputDevice_GetFeatureReport_Response
err zx/status

InputDevice_SendOutputReport_Result

Defined in fuchsia.input.report/device.fidl

NameTypeDescription
response InputDevice_SendOutputReport_Response
err zx/status

InputDevice_SetFeatureReport_Result

Defined in fuchsia.input.report/device.fidl

NameTypeDescription
response InputDevice_SetFeatureReport_Response
err zx/status

InputReportsReader_ReadInputReports_Result

Defined in fuchsia.input.report/device.fidl

NameTypeDescription
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
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