On Tue, Feb 15, 2005 at 06:40:37PM -0500, Dan Streetman wrote:
> 
> Hi Vojtech,
> 
> I have a question about the "contract" of the evdev interface...
> 
> I have 2 touch screens, both USB.  Both of them have drivers (hid-input 
> and mtouchusb) that provide ABS_X and ABS_Y coordinates to the input 
> subsystem and so I read those coordinates from userspace.
> 
> However, one of the touch screens (ELO, via hid-input) reports coordinates 
> with the origin in the upper-left corner, i.e. touching the upper-left 
> corner of the screen reports 0,0.  The other touch screen (3M, via 
> mtouchusb) reports coordinates with the origin at the bottom-left corner.
> 
> So my question is, can an evdev app assume a specific origin?

Yes, Linux input layer defines decreasing values to be the same as HID,
that is up, far from the user, and left.

Zero can be anywhere, but if only positive values are returned, it must
be in the upper left corner.

> Normal screen origin, i.e. upper-left, would make the most sense to
> me.  If so, it seems that mtouchusb should flip its Y coordinates
> before sending to the input subsystem (which would be an easy patch of
> course).

It doesn't flip them while it should flip the Y coordinate. This is
because many touchscreens have [0,0] in their bottom left corner by
hardware, being in the 1st quadrant, which is considered most logical by
many.

I fixed it in my tree.

> Or, can an app not rely on evdev's coordinate origin being
> upper-left?

Yes and no. You can rely that the driver will try to have [0,0] in the
upper left corner, however this can be marred by the user turning the
touchscreen 180 degrees on the monitor to get the cables on a more
convenient side. This happens quite often.

A complete matrix axis transformation is necessary then.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to