Does touchpads have buttons?

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 30 05:58:00 PDT 2008


On Tue, Sep 30, 2008 at 11:53:44AM +0200, Søren Hauberg wrote:
> Okay, so I'm attaching my latest patch. This should handle everything
> except setting/getting calibration parameters. I'll look into this
> after lunch today. I'd love some feedback on the patch, as I think
> this is the best structure, but since I'm a newbie I just might be
> mistaken.


+    /* Touch screen parameters */
+    struct {
+        BOOL                flip_x;
+        BOOL                flip_y;
+        BOOL                swap_xy; /* Some devices send (y, x) instead of (x, y). Currently not used */
+        int                 min_x;
+        int                 max_x;
+        int                 min_y;
+        int                 max_y;
+    } touchscreen;

the last four fields are redundant, since the EvdevRec already has those.
flip_x/y should also be moved into the EvdevRec, as it allows other devices to
benefit from it. For relative devices flip would be simply inverted. For
absolute ones - you can do the inversion before the call to
xf86PostMotionEvent. 
On that note - please replace "flip_x" with "invert_x" etc. Flip is
ambiguous.

regarding swap_x/y:
do i read that right that these devices advertise x/y but then send y/x
coordinates? 

So the kernel driver says that X, Y have ranges of - say - [0, 1000], [-1000,
0], the actual coordinates come through as -500, 500?
If this is the case, please fix the kernel driver, I don't really like the
current solution.

+    
+    if (pEvdev->flags & EVDEV_TOUCHSCREEN)
+        EvdevInitTouchscreen(pInfo);

I trust that'll disappear from the final patch.

So, summary:
- we separate the invert_x/y part into a separate patch, plus the code needed
  for relative devices.
- we ignore the swap x/y crazyness for now.
- we can ditch hunks 2 and 7 from the evdev.c patch.

I like it.

and by "we" I mean of course "you" ;)
since you're the one with the device, please focus on the last two of the
three points. axis inversion can be added easily lateron by anyone with axes
to exotic devices such as mice or touchpads.

Cheers,
  Peter



More information about the xorg mailing list