Generating and reporting input events
Device allocation and registration are essential, but they are useless if the device is unable to report events to the input core, which is what input devices are designed to do. Depending on the type of event our device can support, 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 the mappings between the most important event types and their report functions:
The prototypes for these report APIs are as follows:
void input_report_abs(struct input_dev *dev, unsigned int code, int value) void input_report_key(struct input_dev *dev, ...