input_host_callbacks Struct Reference

input_host_callbacks Struct Reference

#include < input.h >

Data Fields

input_device_identifier_t *(*  create_device_identifier )( input_host_t *host, const char *name, int32_t product_id, int32_t vendor_id, input_bus_t bus, const char *unique_id)
 
input_device_definition_t *(*  create_device_definition )( input_host_t *host)
 
input_report_definition_t *(*  create_input_report_definition )( input_host_t *host)
 
input_report_definition_t *(*  create_output_report_definition )( input_host_t *host)
 
void(*  free_report_definition )( input_host_t *host, input_report_definition_t *report_def)
 
void(*  input_device_definition_add_report )( input_host_t *host, input_device_definition_t *d, input_report_definition_t *r)
 
void(*  input_report_definition_add_collection )( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, int32_t arity)
 
void(*  input_report_definition_declare_usage_int )( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, input_usage_t usage, int32_t min, int32_t max, float resolution)
 
void(*  input_report_definition_declare_usages_bool )( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, input_usage_t *usage, size_t usage_count)
 
input_device_handle_t *(*  register_device )( input_host_t *host, input_device_identifier_t *id, input_device_definition_t *d)
 
void(*  unregister_device )( input_host_t *host, input_device_handle_t *handle)
 
input_report_t *(*  input_allocate_report )( input_host_t *host, input_report_definition_t *r)
 
void(*  input_report_set_usage_int )( input_host_t *host, input_report_t *r, input_collection_id_t id, input_usage_t usage, int32_t value, int32_t arity_index)
 
void(*  input_report_set_usage_bool )( input_host_t *host, input_report_t *r, input_collection_id_t id, input_usage_t usage, bool value, int32_t arity_index)
 
void(*  report_event )( input_host_t *host, input_device_handle_t *d, input_report_t *report)
 
input_property_map_t *(*  input_get_device_property_map )( input_host_t *host, input_device_identifier_t *id)
 
input_property_t *(*  input_get_device_property )( input_host_t *host, input_property_map_t *map, const char *key)
 
const char *(*  input_get_property_key )( input_host_t *host, input_property_t *property)
 
const char *(*  input_get_property_value )( input_host_t *host, input_property_t *property)
 
void(*  input_free_device_property )( input_host_t *host, input_property_t *property)
 
void(*  input_free_device_property_map )( input_host_t *host, input_property_map_t *map)
 

Detailed Description

Definition at line 409 of file input.h .

Field Documentation

input_device_definition_t *(* create_device_definition)( input_host_t *host)

Allocates the device definition which will describe the input capabilities of a device. A device definition may be used to register as many devices as desired.

Definition at line 424 of file input.h .

input_device_identifier_t *(* create_device_identifier)( input_host_t *host, const char *name, int32_t product_id, int32_t vendor_id, input_bus_t bus, const char *unique_id)

Creates a device identifier with the given properties. The unique ID should be a string that precisely identifies a given piece of hardware. For example, an input device connected via Bluetooth could use its MAC address as its unique ID.

Definition at line 416 of file input.h .

input_report_definition_t *(* create_input_report_definition)( input_host_t *host)

Allocate either an input report, which the HAL will use to tell the host of incoming input events, or an output report, which the host will use to tell the HAL of desired state changes (e.g. setting an LED).

Definition at line 431 of file input.h .

input_report_definition_t *(* create_output_report_definition)( input_host_t *host)

Definition at line 432 of file input.h .

void(* free_report_definition)( input_host_t *host, input_report_definition_t *report_def)

Frees the report definition.

Definition at line 437 of file input.h .

Allocate a report that will contain all of the state as described by the given report.

Definition at line 488 of file input.h .

void(* input_device_definition_add_report)( input_host_t *host, input_device_definition_t *d, input_report_definition_t *r)

Append the report to the given input device.

Definition at line 442 of file input.h .

void(* input_free_device_property)( input_host_t *host, input_property_t *property)

Frees the input_property_t*.

Definition at line 535 of file input.h .

void(* input_free_device_property_map)( input_host_t *host, input_property_map_t *map)

Frees the input_property_map_t*.

Definition at line 540 of file input.h .

input_property_t *(* input_get_device_property)( input_host_t *host, input_property_map_t *map, const char *key)

Retrieve a property for the device with the given key. Returns NULL if the key does not exist, or an input_property_t* that must be freed using input_free_device_property() . Using an input_property_t after the corresponding input_property_map_t is freed is undefined.

Definition at line 517 of file input.h .

input_property_map_t *(* input_get_device_property_map)( input_host_t *host, input_device_identifier_t *id)

Retrieve the set of properties for the device. The returned input_property_map_t* may be used to query specific properties via the input_get_device_property callback.

Definition at line 509 of file input.h .

const char*(* input_get_property_key)( input_host_t *host, input_property_t *property)

Get the key for the input property. Returns NULL if the property is NULL. The returned const char* is owned by the input_property_t.

Definition at line 524 of file input.h .

const char*(* input_get_property_value)( input_host_t *host, input_property_t *property)

Get the value for the input property. Returns NULL if the property is NULL. The returned const char* is owned by the input_property_t.

Definition at line 530 of file input.h .

void(* input_report_definition_add_collection)( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, int32_t arity)

Add a collection with the given arity and ID. A collection describes a set of logically grouped properties such as the X and Y coordinates of a single finger touch or the set of keys on a keyboard. The arity declares how many repeated instances of this collection will appear in whatever report it is attached to. The ID describes the type of grouping being represented by the collection. For example, a touchscreen capable of reporting up to 2 fingers simultaneously might have a collection with the X and Y coordinates, an arity of 2, and an ID of INPUT_COLLECTION_USAGE_TOUCHSCREEN. Any given ID may only be present once for a given report.

Definition at line 455 of file input.h .

void(* input_report_definition_declare_usage_int)( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, input_usage_t usage, int32_t min, int32_t max, float resolution)

Declare an int usage with the given properties. The report and collection defines where the usage is being declared.

Definition at line 462 of file input.h .

void(* input_report_definition_declare_usages_bool)( input_host_t *host, input_report_definition_t *report, input_collection_id_t id, input_usage_t *usage, size_t usage_count)

Declare a set of boolean usages with the given properties. The report and collection defines where the usages are being declared.

Definition at line 470 of file input.h .

void(* input_report_set_usage_bool)( input_host_t *host, input_report_t *r, input_collection_id_t id, input_usage_t usage, bool value, int32_t arity_index)

Add a boolean usage value to a report.

Definition at line 499 of file input.h .

void(* input_report_set_usage_int)( input_host_t *host, input_report_t *r, input_collection_id_t id, input_usage_t usage, int32_t value, int32_t arity_index)

Add an int usage value to a report.

Definition at line 493 of file input.h .

Register a given input device definition. This notifies the host that an input device has been connected and gives a description of all its capabilities.

Definition at line 479 of file input.h .

void(* report_event)( input_host_t *host, input_device_handle_t *d, input_report_t *report)

Definition at line 502 of file input.h .

void(* unregister_device)( input_host_t *host, input_device_handle_t *handle)

Unregister the given device

Definition at line 483 of file input.h .


The documentation for this struct was generated from the following file:
  • hardware/libhardware/include/hardware/ input.h