{"id":407,"date":"2009-12-02T15:30:45","date_gmt":"2009-12-02T14:30:45","guid":{"rendered":"http:\/\/www.enricoros.com\/blog\/?p=407"},"modified":"2013-04-21T15:51:15","modified_gmt":"2013-04-21T22:51:15","slug":"im-going-multi-touch","status":"publish","type":"post","link":"https:\/\/www.enricoros.com\/oldblog\/2009\/12\/im-going-multi-touch\/","title":{"rendered":"I&#8217;m going Multi-Touch"},"content":{"rendered":"<p>This is one of the <em>hottest topics<\/em> of the moment: <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multi-touch\" target=\"_blank\">Multi-Touch<\/a> (see the trends\u00a0<a href=\"http:\/\/www.google.com\/trends?q=multitouch\" target=\"_blank\">here<\/a>). Every review of the\u00a0<a href=\"http:\/\/labs.trolltech.com\/blogs\/2009\/12\/01\/qt-460-released-early-due-to-good-behaviour\/\" target=\"_blank\">just released<\/a> Qt <a href=\"http:\/\/doc.trolltech.com\/4.6\/\">4.6<\/a> mentions the Touch-and-Gestures framework and KDE is <a href=\"http:\/\/www.notmart.org\/index.php\/Software\/Multitouch_screencast_overload\" target=\"_blank\">getting ready to use the technology<\/a> &#8212; <span style=\"text-decoration: underline;\">still it doesn&#8217;t work on X11<\/span> (<em>yet<\/em>).<\/p>\n<h3>MultiTouch can be <em>Fun <\/em>!<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-413\" title=\"Wacom_Bamboo-Fun-small\" src=\"http:\/\/www.enricoros.com\/blog\/wp-content\/uploads\/2009\/12\/Wacom_Bamboo-Fun-small1.png\" alt=\"Wacom_Bamboo-Fun-small\" width=\"197\" height=\"124\" \/>I couldn&#8217;t resist, so for 99\u20ac (120$) I bought a <em>Bamboo Fun Pen &amp; Touclh<\/em> tablet. I find this really affordable, since you get: A. the precision of a graphics tablet (with 1024 pressure levels, back eraser, etc..) and B. a real 2-Pointers input device!<\/p>\n<p>I tried the tablet on vista, with the latest drivers and the bundled applications bot I got disappointed because:<br \/>\n<em>1.<\/em> <em>the scroll gesture\u00a0is remapped to the mouse wheel<\/em>.. so you lose all the &#8216;analog&#8217; fun and it feels unconfortable.<br \/>\n<em>2. the zoom gesture is remapped to CTRL+wheel<\/em>, awkward fixed-steps again.<br \/>\n<em>3. the rotate gesture is not supported by any app<\/em> even the bundled ones i tried.<\/p>\n<p>In the end I thought this was not &#8220;multi-touch&#8221;, but some silly gesture-detection broken hardware. <em>I was wrong<\/em>.<\/p>\n<h3>Linux to the rescue<\/h3>\n<p><a href=\"http:\/\/www.enricoros.com\/blog\/wp-content\/uploads\/2009\/12\/gesture-vortex-2H.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-438 aligncenter\" title=\"gesture-vortex-2S\" src=\"http:\/\/www.enricoros.com\/blog\/wp-content\/uploads\/2009\/12\/gesture-vortex-2S1.png\" alt=\"gesture-vortex-2S\" width=\"425\" height=\"299\" srcset=\"https:\/\/www.enricoros.com\/oldblog\/wp-content\/uploads\/2009\/12\/gesture-vortex-2S1.png 425w, https:\/\/www.enricoros.com\/oldblog\/wp-content\/uploads\/2009\/12\/gesture-vortex-2S1-300x211.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/a><br \/>\n<span style=\"text-decoration: underline;\">Step 1<\/span>. After loading the wacom.ko module (updated with <a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=1321238#1\" target=\"_blank\">this<\/a> patch) the Linux kernel prints out stuff like this:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;default   ] data: 02 00  00 00 00 00 00  00 00 00 00  00 00 00 00 00  00 00 00 00\r\n&#x5B;finger 1  ] data: 02 00  7d 80 fe 00 8a  80 fc 00 87  00 00 00 00 00  81 11 00 00\r\n&#x5B;finger 1+2] data: 02 00  ae 80 b6 00 72  81 08 00 70  87 81 5b 00 72  81 21 00 00\r\n&#x5B;finger   2] data: 02 00  00 00 00 00 00  81 59 00 b4  6d 81 59 00 ba  80 11 00 00\r\n<\/pre>\n<p>Can you see it ? This <strong>is<\/strong> a 2-finger device! \ud83d\ude42<\/p>\n<p><span style=\"text-decoration: underline;\">Step 2<\/span>. The Kernel understands the data and splits it into 2 input devices that Udev maps to\u00a0<em>\/dev\/input\/wacom<\/em> and <em>\/dev\/input\/wacom-touch<\/em>. From here you can read higher level information <strong>for each finger<\/strong> such as the decoded <strong>position<\/strong>, <strong>pressure<\/strong>, click type (<strong>tap<\/strong>, <strong>doubletab<\/strong>), and more.<\/p>\n<h3>I WANT QTouchEvents AND QGestures !!<\/h3>\n<p>I do too \ud83d\ude00 And I wanted to hack something about that. But I stopped here:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-436\" title=\"schema-problem\" src=\"http:\/\/www.enricoros.com\/blog\/wp-content\/uploads\/2009\/12\/schema-problem.png\" alt=\"schema-problem\" width=\"507\" height=\"207\" srcset=\"https:\/\/www.enricoros.com\/oldblog\/wp-content\/uploads\/2009\/12\/schema-problem.png 507w, https:\/\/www.enricoros.com\/oldblog\/wp-content\/uploads\/2009\/12\/schema-problem-300x122.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/p>\n<p>We get the input from <em>evdev<\/em> and the Application needs <a href=\"http:\/\/doc.trolltech.com\/4.6\/qtouchevent.html\" target=\"_blank\">QTouchEvent<\/a>s and <a href=\"http:\/\/doc.trolltech.com\/4.6\/qgesture.html\" target=\"_blank\">QGesture<\/a>s, so the easy way would be to hack up a touchpoint feeder to the Qt framework that directly reads from evdev (<strong>evdev -&gt; qt<\/strong>). This would work fine for 1 application, but what about two? And what about moving the X cursor too? I think <strong>evdev-&gt;Xdriver-&gt;XInput2-&gt;qt<\/strong> is the solution, but we must be sure that <em>no valuable information is lost in the chain<\/em>, that the <em>event filtering is done in the right place<\/em> and obviously, that the X driver does a good job. Unfortunately <a href=\"http:\/\/cgit.freedesktop.org\/~whot\/xf86-input-wacom\/\" target=\"_blank\">xf86-input-wacom<\/a> (X input driver for wacom&#8217;s kernel driver) doesn&#8217;t support my Bamboo Fun Touch &amp; Pen yet and moreover I don&#8217;t see MPX support in the sources, so I&#8217;m wondering how far away is the Qt multi-touch backend from seeing the light.<\/p>\n<h3>Conclusion<\/h3>\n<p>I don&#8217;t know which way the multi-touch will happen on linux, but I know for sure that\u00a0we want to play with gestures and we want it soon \ud83d\ude00<\/p>\n<p>For more information:<\/p>\n<ul>\n<li>Peter Hutterer&#8217;s <a href=\"http:\/\/who-t.blogspot.com\/\" target=\"_parent\">blog<\/a>. Peter is the MPX (Multi Pointer X) author and plays a big role in the X.org community.<\/li>\n<li>X Input Extension 2.0 <a href=\"http:\/\/fedoraproject.org\/wiki\/Features\/XI2\" target=\"_blank\">features<\/a>.<\/li>\n<li>The\u00a0<a href=\"http:\/\/linuxwacom.sourceforge.net\/\" target=\"_blank\">Linux Wacom<\/a> project. A community-driven effort to develop kernel and X drivers.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is one of the hottest topics of the moment: Multi-Touch (see the trends\u00a0here). Every review of the\u00a0just released Qt 4.6 mentions the Touch-and-Gestures framework and KDE is getting ready to use the technology &#8212; still it doesn&#8217;t work on X11 (yet). MultiTouch can be Fun ! I couldn&#8217;t resist, so for 99\u20ac (120$) I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10,13,33,23,24,26,34],"class_list":["post-407","post","type-post","status-publish","format-standard","hentry","category-senza-categoria","tag-avanguardia","tag-creativity","tag-multi-touch","tag-planetkde","tag-planetqt","tag-qt","tag-x-org"],"_links":{"self":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":34,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/407\/revisions\/409"}],"wp:attachment":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/media?parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/categories?post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/tags?post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}