Redirecting touch protocol-B to other uinput virtual touch A-protocol device

  android, android-kernel, c++, linux

Here is the touch protocol-A and B i tried to redirect touch protocol-B to A so i maded a new uinput device in Android root is there any why i can do this and redirect all touch protocol commnds protocol-B to A so the B send all data to A is there any why?

For a two-touch touch message, the smallest sequence of events for a device of type a looks like this:

Abs_mt_position_x X[0]

Abs_mt_position_y Y[0]

Syn_mt_report

Abs_mt_position_x X[1]

Abs_mt_position_y Y[1]

Syn_mt_report

Syn_report

In fact, the escalation sequence after moving one of the touch points looks the same, all the original data that has the touch points are sent, and then synchronized with syn_report between them.

When the first point of contact leaves, the sequence of events is as follows:

Abs_mt_position_x X[1]

Abs_mt_position_y Y[1]

Syn_mt_report

Syn_report

When the second point of contact leaves, the sequence of events is as follows:

Syn_mt_report

Syn_report

If the driver reports a Btn_touch or Abs_pressure event outside of the ABS_MT event, the last Syn_mt_report can be omitted, otherwise, the final syn_report will be thrown away by the input core layer, The result is a 0 touch point event being uploaded to the user space.

Protocol Example B

For a two-touch touch message, the smallest sequence of events for type B devices looks like this:

Abs_mt_slot 0

ABS_MT_TRACKING_ID 45

Abs_mt_position_x X[0]

Abs_mt_position_y Y[0]

Abs_mt_slot 1

ABS_MT_TRACKING_ID 46

Abs_mt_position_x X[1]

Abs_mt_position_y Y[1]

Syn_report

The sequence of events after the touch point of ID 45 moves in the x direction is as follows:

Abs_mt_slot 0

Abs_mt_position_x X[0]

Syn_report

After the contact point for slot 0 is left, the corresponding sequence of events is as follows:

Abs_mt_tracking_id-1

Syn_report

The last modified slot is also 0, so Abs_mt_slot is omitted. This message removes the slot 0 associated with the contact point 45, so the contact point 45 is destroyed and slot 0 is freed to be reused by another point of contact.

Finally, the time sequence after the second contact point leaves is as follows:

Abs_mt_slot 1

Abs_mt_tracking_id-1

Syn_report

Use of events

Source: Windows Questions C++

LEAVE A COMMENT