On Wed, Dec 8, 2010 at 10:45 PM, Peter Hutterer
<[email protected]> wrote:
> On Wed, Dec 08, 2010 at 10:03:36AM -0800, Ping Cheng wrote:
>> On Tue, Dec 7, 2010 at 9:27 PM, Peter Hutterer <[email protected]> 
>> wrote:
>> > On Tue, Dec 07, 2010 at 01:29:36PM -0800, Ping Cheng wrote:
>> >> The physical size of the touch pad is reported in 1000 cm. The
>> >
>> > sorry, I'm confused. it's reported in what? 1000 units/cm?
>>
>> You are not alone. I was confused too. The term I used above is still
>> inaccurate. It should read as:
>>
>> "The physical size of the touch pad is reported in thousandths of 
>> centimetres."
>>
>> For example, a physical value of 18500, that we get from the HID
>> descriptor, would be 18.5 cm or 185 mm. Since we use mm for touch
>> resolution, the actual physical size would be PhyTouch/100.
>
> we use units/m as a resolution in the X Input Extension. and that's the only
> place to get the resolution for clients.
> http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XIproto.txt#n471

I'll change this patch into points/m and update the commit comments accordingly.

Ping

> my I4 currently claims 5080 (hardcoded, wcmUSB.c), but after measuring my
> tablet with 232mm and an x range of 44704, this should be a resolution of
> around 192689 (200 000 would be 5080/0.0254). so this is currently wrong
> anyway.
>
> Cheers,
>  Peter
>
>> I know we'll  need to unify the unit for touch and pen. That would be
>> a future patch.
>>
>> Please update the comments the way you like if you don't have
>> technical issues with the patch. I am feeling lazy today....
>>
>> Ping
>>
>> >> actual fomula to get points/mm would be:
>> >>
>> >>          MaxTouch/PhyTouch/100
>> >>
>> >> Signed-off-by: Ping Cheng <[email protected]>
>> >> ---
>> >>  src/wcmUSB.c |    9 +++++----
>> >>  1 files changed, 5 insertions(+), 4 deletions(-)
>> >>
>> >> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
>> >> index c53ff06..600ffda 100644
>> >> --- a/src/wcmUSB.c
>> >> +++ b/src/wcmUSB.c
>> >> @@ -495,10 +495,11 @@ int usbWcmGetRanges(InputInfoPtr pInfo)
>> >>
>> >>       if (is_touch && common->wcmTouchResolX && common->wcmMaxTouchX)
>> >>       {
>> >> -             common->wcmTouchResolX = 
>> >> (int)(((double)common->wcmTouchResolX)
>> >> -                      / ((double)common->wcmMaxTouchX) + 0.5);
>> >> -             common->wcmTouchResolY = 
>> >> (int)(((double)common->wcmTouchResolY)
>> >> -                      / ((double)common->wcmMaxTouchY) + 0.5);
>> >> +             /* physical size is reported in 1000 cm */
>> >> +             common->wcmTouchResolX = 
>> >> (int)(((double)common->wcmMaxTouchX)
>> >> +                      / ((double)common->wcmTouchResolX/100.0) + 0.5);
>> >> +             common->wcmTouchResolY = 
>> >> (int)(((double)common->wcmMaxTouchY)
>> >> +                      / ((double)common->wcmTouchResolY/100.0) + 0.5);
>> >>
>> >>               if (!common->wcmTouchResolX || !common->wcmTouchResolY)
>> >>               {
>> >> --
>> >> 1.7.2.3
>> >>
>> >
>>
>

------------------------------------------------------------------------------
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to