[Development] Multitouch on top of XInput 2.2

Christian Spielberger c.spielberger at bct-electronic.com
Thu Jul 19 15:14:53 CEST 2012


> I noticed you deleted the code to deal with the valuators completely, so that
> means in your branch there is no support for pressure or major/minor axes,
> right?  When I run fingerpaint against your branch, it is indeed insensitive
> to pressure, I just get circles all the same size.  I don't think you should
> be ignoring all the valuators, even though you are correctly making use of the
> given points from the event itself.
>

I re-inserted the valuator evaluation for pressure, major- and minor 
axes. The major axis valuator (AbsMTTouchMajor) has random outliers, 
which does not come from the kernel modul. The evtest tool reports 
correct values. So maybe worth to be further investigated by the Xorg 
maintainer(s). My device is an "Atmel maXTouch Touchscreen".

> The axes are supposed to describe the size and shape of the elliptical contact
> patch of your finger against the touch device.  I have tested my Qt 5 patch on
> the following devices:
>
> Lenovo S10-3t: has neither pressure nor axes; 2 points max
>
> Apple Bluetooth trackpad: has major and minor axes plus (bogus?) orientation,
> 5 points max; points from the XI2 event are all at the same position as the
> cursor
>
> Apple trackpad on a Macbook Pro (17" from 2009 or so): has major and minor
> axes plus ABS Pressure (NOT Abs MT Pressure), 5 points max; forgot whether it
> has orientation; points from the XI2 event are all at the same position as the
> cursor
>
> ExoPC: no axes, has Abs MT Pressure but sometimes I have seen it go to the
> minimum possible value if there are 2 fingers.  10 points max.
>
> What I mean by "bogus orientation" on the trackpad is that instead of having
> per-finger orientation, it exists only if 2 or more fingers are pressed, so it
> would seem to be related to the angle between them; but it's quite jumpy, and
> I'm not sure what a range from -31 to +32 is supposed to mean anyway.  High-
> end Wacom tablets apparently give 3 angles: the rotation of the stylus, and
> two vertical angles w.r.t. the Wacom surface.  I think the orientation is
> supposed to be like the stylus rotation angle, and should really be on a per-
> finger basis, so I guess we should call it rotation to be consistent, so that
> we are ready in case future touch devices report more than one angle as well.
> If the trackpad has a high density grid of capacitive sensors, then I think
> the idea is that trackpad's processor should be fitting an ellipse to each
> blob, and reporting the width, height and rotation of the ellipse.  (Or maybe
> the driver does it?)  If rotation was really not reported from each of the
> curve-fit ellipses, I wonder why.
>
> The data coming from the BT trackpad looks like this
>
> XI2 event type 19 seq 333 detail 400 pos 0x3D00000,0x28F0000
> 976.000000,655.000000 root pos 2896.000000,679.000000
>     valuator class label 636 value 71.000000 from range -2909.000000 ->
> 3167.000000 name Abs MT Position X
>     valuator class label 637 value -14.000000 from range -2456.000000 ->
> 2565.000000 name Abs MT Position Y
>     valuator class label 638 value 128.000000 from range 0.000000 -> 255.000000
> name Abs MT Touch Major
>     valuator class label 639 value 168.000000 from range 0.000000 -> 255.000000
> name Abs MT Touch Minor
>     tp  400  state  2  pos norm  QPointF(0.490454, 0.486357)  area
> QRectF(2886.81,666.686 18.3749x24.6289) angle 0  pressure  -1
>
> but with even larger values for the axes on the Macbook Pro.  So I decided to
> convert the value such that that maximum value corresponds to max finger width
> in mm (it's #defined to 10mm - perhaps a bit much) and convert that to pixels
> based on the actual screen resolution.
>

Maybe a good decision. I took the absolute values of AbsMTTouchMajor. 
 From AbsMTPressure I compute the relative value based on the min-max 
difference. In the fingerpaint example this gives visible different 
point sizes, even though smaller than my finger. But that's all we need 
for now.

You can find my repo at:
https://www.gitorious.org/~cspiel/qt/cspiels-qt-4_8-with-xinput2_1#more

branch:
4.8-XI2.2-touch

regards,
chris.



More information about the Development mailing list