When I get a touch event with its coordinate in android frameworks,
I can use ioctl to send the user event to kernel,
then let the driver convert it to system input event.( use: input_sync, input_report_key, input_report_abs etc.)
The problem is:
As i known, the android swipe events may like this:(swipe down)
{ type, code, value }
{3,48,5}, {3,50,1}, {3,53,240}, {3,54,400},
{1,330,1},
{3,58,255}, {3,57,0},
{0,2,0},{0,0,0},
{3,48,0},{3,50,1},{3,53,240},{3,54,450},{3,58,255},{3,57,0},
{0,2,0},{0,0,0},
{3,0,0},{3,1,450},{3,57,15},
{0,0,0},{1,330,0},
{3,48,0},{3,50,1},{3,53,240},{3,54,450},{3,58,0},
{0,2,0},{0,0,0}
type=0, represents sync
type=1, represents key
type=3, code=53,54, value represents coordinate
type=3, code=48,50,57,58, value represents touch tool propertys.
so, only type=3, code=53,54 or type=1 are the input parameters, others need to be inserted in the convertion of user event to system event.
Should I coding like this:
// in driver
if ( get an event )
{
report touch tool event;
report the x,y/key event; // from input params
report the sync event;
}
or there is a better way?
thank you.
I found linux uinput interface, which can generate input events in user space more convenient.
http://thiemonge.org/getting-started-with-uinput