Is there any documentation on the format of the getevent and sendevent shell commands? specifically the ones for touchevents. or is this device-dependent?
it is a bit hard to guess what those ids are doing.
There is some documentation on the AOSP site:
Plus several Howtos like e.g.
However, the answer to your question on Google Groups states:
No, this is fairly device-dependent. getevent prints a summary of all the devices so you know what those are. The data generated for a device are generally the Linux kernel's event protocol, so you can look there for further help, but there is no guarantee that a particular device will be following those conventions.
That will depend on the factors for the kernel in question:
uinputenabled then that's good...
If this passes the three criteria above, then by reading certain events from
/dev/input/eventX where X is a number - this will be determined at boot-time, depending on the ordering of loading the appropriate drivers. This will vary but you can try it out and see:
adb shell cat /dev/input/eventX (where X is a number, you will need to know before hand!)
/dev/input/eventX being outputted.
The values are in encoded form, based on the kernel's input structure -
struct input_event which can be found in most kernel sources under
Be careful! Depending on the touchscreen driver used, some, do not actually return the proper coordinates - that's left as an exercise :)
On the Samsung GT-i5500 running Eclair,
/dev/input/event2 is the touchscreen and the values are in encoded form, this is not to be taken for granted as that will depend on what touchscreen driver is used. On the Sony ST15i, running ICS, its, surprisingly, the same! But on the Zte Blade, its
Incidentally, I did some work about a year ago, on creating a touchscreen for ClockWorkMod Recovery which can be found over on Modaco.
The real painful part was trying to determine which event was the touchscreen and act on it accordingly which was ported over to Zte Skate, Zte Racer and Samsung GT-i5500.