2

我能够从 Android 手机上的 dev/input/event* 读取事件。然而,它们是特定顺序的行代码,就像触摸事件给出的那样。

3 53 216

3 54 444

3 48 40

3 50 5

0 2 0

0 0 0

如何将它们解析为有意义的事件,例如 x 和 y 坐标处的触摸?或长按等。然后我想将高级事件转换回类似的代码以将它们插入事件队列中。

有没有人有 C/C++ 中的解析器代码?

非常感谢任何帮助。

4

2 回答 2

2

您可以在 external\kernel-headers\original\linux\Input.h 中看到 android 内核源代码中定义的 struct input_event

于 2013-12-05T13:12:26.240 回答
0

我知道这个问题很老,但这是答案http://blog.softteco.com/2011/03/android-writing-events-low-level-touch.html

于 2013-05-28T01:59:18.730 回答