2

I am able to read events from dev/input/event* on a Android phone. However they are row codes in certain sequence like a touch event gives.

3 53 216

3 54 444

3 48 40

3 50 5

0 2 0

0 0 0

How do I parse them into meaningful events like touch at x and y coordinate? Or a long touch etc. And then I want to convert high level events back to similar codes to insert them in event queue.

Does any one have parser code in C/C++?

Any help greatly appreciated.

3
  • how you read event from /dev/input/event ? Commented Apr 12, 2013 at 12:38
  • pocketmagic.net/2013/01/… Commented Apr 12, 2013 at 12:41
  • This is quite device specific. It's not hard to figure out by experiment on a given device, but that information is not necessarily transferable to other makes/models or even other android versions on the same hardware. Commented Apr 12, 2013 at 15:59

2 Answers 2

2

u can see struct input_event defined in android kernel source code in external\kernel-headers\original\linux\Input.h

Sign up to request clarification or add additional context in comments.

Comments

0

I know this question is old, but here is the answer http://blog.softteco.com/2011/03/android-writing-events-low-level-touch.html

2 Comments

Please summarise the link in your answer; that way, if the link goes stale the answer won't be completely useless. (BTW, we don't care how long it takes for a question to be answered, as long as the answer's a good one.)
Bojan - Thanks for attempting to answer. I understand the relevance of each command. You can also get more details from kernel.org/doc/Documentation/input/multi-touch-protocol.txt . Eg: If you draw a circle on screen, it might produce more than 2000 inputs on S3 and sequence of these commands is variating. OS is able to parse them and convert them into high level commands like drag etc... How can we do the equivalent? A good parser would help..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.