Generating and reporting an input event
Device allocation and registration are essential, but they are not the main goals of an input device driver, which is designed to report events to the input core. Depending on the type of event your device supports, the kernel provides the appropriate APIs to report them to the core.
Given an EV_XXX
capable device, the corresponding report function would be input_report_xxx()
. The following table shows mappings between the most important event types and their report functions:
Event type | Report function | Code example |
|
|
|
|
|
|
|
|
|
Their respective prototypes are as follows:
void...