Touchscreen : values,unit...

100 views
Skip to first unread message

Arnaud Frigout

unread,
Apr 7, 2010, 3:15:39 AM4/7/10
to android-porting
Hello All:

I'm porting Android on an imx51 for a new touchscreen.
I know Android use the touchscreen like an input device but I don't
know what are the values it wants? (X,Y,...) What is the unit? (pixel,
mm...)
Do you know which part of Android read the event file (dev/input/
event) of the touchscreen?
Where can I find a documentattion on this item?


Best regards,

Arnaud Frigout

Deva R

unread,
Apr 7, 2010, 3:41:51 PM4/7/10
to arnaud....@gmail.com, android-porting
> I know Android use the touchscreen like an input device but I don't
> know what are the values it wants? (X,Y,...) What is the unit? (pixel,
> mm...)

It will be (x,y) co-ordinates, where (0,0) being the top-left of the
screen and (max-x, max-y) being the bottom of the screen.

how it works:
- when user taps touch screen, it generates an interrupt and its the
trigger for touch screen driver to read the (x,y) co-ordinate from
touch-screen controller.
touch screen controller returns samples that its h/w calculated. (can
be resistive/capacitive).

Once, x,y coordinates are ready, driver publishes using input_report_abs calls.
its still a black box for me, how OS takes (x,y) from this user event,
maps to a framebuffer locaiton, and do some stuff..

u can refer a sample touch screen driver at
http://git.omapzoom.org/?p=kernel/omap.git;a=blob;f=drivers/input/touchscreen/tsc2007.c

>> Do you know which part of Android read the event file (dev/input/event) of the touchscreen?

EventHub.., "Grand Central Station for events" - as called by android team ;P
./frameworks/base/libs/ui/EventHub.cpp
Link - http://git.omapzoom.org/?p=platform/frameworks/base.git;a=blob;f=libs/ui/EventHub.cpp

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>
> To unsubscribe, reply using "remove me" as the subject.
>

Dianne Hackborn

unread,
Apr 7, 2010, 3:44:49 PM4/7/10
to r.de...@gmail.com, arnaud....@gmail.com, android-porting
KeyInputQueue.java uses JNI calls to ready the events via EventHub.h.  The KeyInputQueue and associated InputDevice classes do the mapping from raw device coordinates to the screen.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Arnaud Frigout

unread,
Apr 8, 2010, 7:03:23 AM4/8/10
to android-porting
Hi Deva R and Dianne Hackborn,

Thanks for the quick reply.

Deva R :
The driver reports BTN_TOUCH, ABS_X, ABS_Y and ABS_PRESSURE.
I know that BTN_TOUCH, ABS_X, ABS_Y must be reported for Android but
is it obligatory for ABS_PRESSURE ?
What's happen if i don't use the PRESSURE?

On the screen in the landscape mode where are X,Y ?
is it like this?
Y<----------------O
|
|
|
V
X

Dianne Hackborn :

What are the minimum and the maximum accepted by Android? (-32 768 à
32 767)
Does Android have an unit for the touchscreen like for the
accelerometer?


Thank you.

Best Regards,
Arnaud Frigout

Deva R

unread,
Apr 8, 2010, 8:30:25 AM4/8/10
to arnaud....@gmail.com, android-porting
Hi,

> The driver reports BTN_TOUCH, ABS_X, ABS_Y and ABS_PRESSURE.
> I know that BTN_TOUCH, ABS_X, ABS_Y must be reported for Android but
> is it obligatory for ABS_PRESSURE ?
> What's happen if i don't use the PRESSURE?

you can see few drivers in <kernel>/drivers/input updating just ABS_X,
ABS_Y, but not ABS_PRESSURE..
I'm not sure of usage of pressure parameter in kernel, it should be optional..

> On the screen in the landscape mode where are X,Y ?
> is it like this?
> Y<----------------O
> |
> |
> |
> V
> X


In platforms i've seen, touchscreen always should give absolute
physical co-ordinates w.r.t panel.
its the job of OS (window server) to process it based on what mode it
currently it is (landscape or portrait mode)..

Arnaud Frigout

unread,
Apr 9, 2010, 2:25:18 AM4/9/10
to android-porting
Hi Deva R,

Do you know what are the minimum and the maximum accepted by Android?
(min=0?)
Is it 16 bits or 32bits?

Thanks you,

Best Regards,
Arnaud Frigout

Reply all
Reply to author
Forward
0 new messages