<div dir="ltr">Hi Peter,<div><br></div><div>Sorry for my late reply because I wen to Beijing for a short business travel.</div><div><br></div><div>Yes, I read about the source code about 1.7.x by apt-get source xserver-xorg-input-synaptics under Linux Deepin 2014, the SHM has been completely removed.</div>
<div>And I do not want to hack the 1.6.x source code under Linux Deepin 2013 to support ABS_MT_SLOT, ABS_MT_POSITION_X && ABS_MT_POSITION_Y sort of multitouch support, even it supports multitouch and gesture recognition, such as <span style="color:rgb(0,0,0);font-family:arial,helvetica,verdana,tahoma,sans-serif;font-size:12px;line-height:20px">2 fingers to zoom out/in, 4 fingers swipe up to show all open windows, 4 fingers swipe right to switch to 2nd work space, 4 fingers swipe left to switch to 1st work space, 3 fingers to move active window</span>, the demo video shown as <a href="http://v.youku.com/v_show/id_XNjU5MTk4MTk2.html">http://v.youku.com/v_show/id_XNjU5MTk4MTk2.html</a> </div>
<div><div class="gmail_extra"><br></div><div class="gmail_extra">You said you are writing the driver with multitouch support using a different base design, can I ask whether or not the driver`s source code will be accepted by xorg official maintainer?</div>
<div class="gmail_extra">Would it be OK for you if I also contribute to your driver? If it is OK, may I have your driver source code version control link such as github or something else?</div><div class="gmail_extra"><br>
</div><div class="gmail_extra">Looking forward to your reply.<br><br>Cheers,</div><div class="gmail_extra">Leslie<br><br><div class="gmail_quote">2014/1/6 Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Sat, Jan 04, 2014 at 04:25:51PM +0800, Leslie Zhai wrote:<br>
> Hi xorg developers,<br>
><br>
> in xserver-xorg-input-synaptics-1.6.2/include/synaptics.h<br>
> the struct _SynapticsSHM is shown as below:<br>
<br>
</div>SHM has been completely removed in synaptics 1.7, it's largely a leftover<br>
from before device properties where it was needed for run-time<br>
configuration. it had't been updated in a while, so any code that deals with<br>
it is likely outdated.<br>
<br>
updating synaptics to support multitouch properly is a bit of a larger<br>
issue, it's likely easier to write the driver from scratch using a different<br>
base design (which I'm currently in the process of doing).<br>
<br>
Cheers,<br>
Peter<br>
<div><div class="h5"><br>
> ```<br>
> typedef struct _SynapticsSHM {<br>
> int version; /* Driver version */<br>
><br>
> /* Current device state */<br>
> int x, y; /* actual x, y coordinates */<br>
> int z; /* pressure value */<br>
> int numFingers; /* number of fingers */<br>
> int fingerWidth; /* finger width value */<br>
> int left, right, up, down; /* left/right/up/down buttons */<br>
> Bool multi[8];<br>
> Bool middle;<br>
> } SynapticsSHM;<br>
> ```<br>
><br>
> there are x and y, because I want to know what they are, then read about<br>
> src/eventcomm.c<br>
> ```<br>
> if (ev.code < ABS_MT_SLOT) {<br>
> switch (ev.code) {<br>
> case ABS_X:<br>
> hw->x = apply_st_scaling(proto_data, ev.value, 0);<br>
> break;<br>
> case ABS_Y:<br>
> hw->y = apply_st_scaling(proto_data, ev.value, 1);<br>
> break;<br>
> case ABS_PRESSURE:<br>
> hw->z = ev.value;<br>
> break;<br>
> case ABS_TOOL_WIDTH:<br>
> hw->fingerWidth = ev.value;<br>
> break;<br>
> }<br>
> }<br>
> ```<br>
><br>
> Why use ABS_X for hw->x?<br>
> I want to recognize multi-touch gesture, such as zoom in/out, with<br>
> ABS_MT_SLOT, ABS_MT_POSITION_X and ABS_MT_POSITION_Y based on Linux<br>
> Multi-touch (MT) Protocol.<br>
> But struct _SynapticsSHM only provides ABS_X and ABS_Y, even there is<br>
> numFingers, it is still unable to distinguish which finger touching the<br>
> point1, point2 or pointN...<br>
><br>
> So I hacked the struct _SynapticsSHM, added int slot, mt_x, mt_y, shown<br>
> as below:<br>
> ```<br>
> typedef struct _SynapticsSHM {<br>
> int version; /* Driver version */<br>
><br>
> /* Current device state */<br>
> int x, y; /* actual x, y coordinates */<br>
> int z; /* pressure value */<br>
> int numFingers; /* number of fingers */<br>
> int fingerWidth; /* finger width value */<br>
> int left, right, up, down; /* left/right/up/down buttons */<br>
> Bool multi[8];<br>
> Bool middle;<br>
><br>
> int slot;<br>
> int mt_x;<br>
> int mt_y;<br>
> } SynapticsSHM;<br>
> ```<br>
><br>
> and also hacked src/eventcomm.c, using ABS_MT_POSITION_X for mt_x, shown<br>
> as below:<br>
> ```<br>
> case EV_ABS:<br>
> if (ev.code == ABS_MT_SLOT)<br>
> hw->slot = ev.value;<br>
> if (ev.code == ABS_MT_POSITION_X)<br>
> hw->mt_x = ev.value;<br>
> if (ev.code == ABS_MT_POSITION_Y)<br>
> hw->mt_y = ev.value;<br>
> ```<br>
><br>
> Then I can use slot, mt_x, mt_y to recognize multi-touch gesture such as<br>
> zoom in, rotate ... but that is hacking way, perhaps there are some<br>
> synaptics developers already considered about multi-touch gesture<br>
> recognization requirement, it might be in TODO list.<br>
><br>
> Please someone give me some advice, thanks a lot!<br>
><br>
> Leslie Zhai<br>
</div></div>> _______________________________________________<br>
> <a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
> Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
> Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
><br>
</blockquote></div><br></div></div></div>