Meego Wiki
Views

User:Jketreno/multi-point-touch

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(touch doesn't work on my system)
Line 2: Line 2:
==multi-point-touch==
==multi-point-touch==
-
During the MeeGo Conference I gave a presentation on multi-point-touch support on MeeGo ([http://conference2010.meego.com/session/multi-touch-meego-hardware-user overview and video] [http://conference2010.meego.com/sites/all/files/sessions/meego-conference-2010-multi-point-touch.odp slides])As mentioned during that presentation, to add multi-point-touch to Qt applications running on top of MeeGo 1.1 requires a few changes.
+
The kernel's multi-touch-protocol is now supported in MeeGo. Qt applications will receive Touch events and can use the Qt gesture infrastructureNon-Qt applications will need to write to XInput2.0 and extract contact data from the XEvent data.
-
The feature in MeeGo's bugzilla which is tracking the status of inclusion can be found [http://bugs.meego.com/show_bug.cgi?id=11625 here].
+
The general flow is:
 +
HW => Kernel driver => multi-touch-protocol => xorg-x11-input-mtev => XEvent => Application
-
As you will find in the comments on that bug, since the MeeGo Conference last year, work has continued to move forward.  The components that need to be changed in current (as of early January 2011) MeeGo systems are now all available in MeeGo Trunk.
+
xorg-x11-input-mtev users libmtdev in order to easily support both of the protocol A and B exposed by the kernel.
-
 
+
-
If you are running an older image, you need to update to the latest version of Qt in Trunk (build version stamp 4.7.1-4 or newer), xorg-x11-drv-mtev (remove xf86-input-mtev if you have it), and mtdev.
+
-
 
+
-
'''NOTE''': If you had previously install the multipointtouchplugin, you need to remove it via one of these methods:
+
-
zypper remove multipointtouchplugin
+
-
or
+
-
rm /usr/lib/qt4/plugins/libmultipointtouchplugin.so
+
-
If you do not remove that plugin, touch will not work correctly with the XInput2.0 enabled version of Qt.
+
===touch doesn't work on my system===
===touch doesn't work on my system===

Revision as of 16:39, 7 March 2011

Random tidbits of information about projects I'm hacking on...

Contents

multi-point-touch

The kernel's multi-touch-protocol is now supported in MeeGo. Qt applications will receive Touch events and can use the Qt gesture infrastructure. Non-Qt applications will need to write to XInput2.0 and extract contact data from the XEvent data.

The general flow is:

HW => Kernel driver => multi-touch-protocol => xorg-x11-input-mtev => XEvent => Application

xorg-x11-input-mtev users libmtdev in order to easily support both of the protocol A and B exposed by the kernel.

touch doesn't work on my system

If you are using the evtouch driver on your system, you may experience problems due to the X evtouch input driver incorrectly advertising that it provides button labels, but not actually setting them to valid X atoms. You can determine if this is the case on your system by running:

xinput list --long "Virtual core pointer"

On a functional input driver, you will see various text names for the field 'Button labels:' On a broken input driver, you will see a series of X BadAtom errors or "Button Unknown" labels. A correct driver will report labels such as: Button Left, Button Right, etc.

See BMC#12777 for additional details on this problem.

enabling a native application

Prior to having patches to Qt to add XInput2.0 support, applications had to load a plugin that would connect to the X event queue and process the XInput2.0 events. That is no longer necessary and applications will now just work.

enabling a QML application

With Qt 4.7.0 through 4.7.2, you can use the qml-gesturearea project from qt-labs to add multi-point touch gestures to your QML applications.

As of Qt 4.7.3, you should use the MouseArea, Flickable, PinchArea, and TouchArea. The GIT tree for TouchArea is here.

Additional information in JIRA can be found here.

multiple input device support

Qt is configured to listen to pointer (mouse) events the first core pointer provided by X. Additional core pointers are ignored. Touch events are received from any touch device bound to the first core pointer, as well as any touch devices which are floating (not bound to any core pointer)

core pointer

If you do nothing, X will default to binding an input device to the first Core Pointer. This means that the touch screen will default to control the cursor --as you move your finger around, mouse events will be generated, the cursor will move, etc.

You can use the xinput utility to "float" the touch device. On the Lenovo S10, running 'xinput list' shows something like the following:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Cando Corporation Cando 10.1 Multi Touch Panel with Controller    id=13   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=16   [slave  pointer  (2)]
...

Looking at the above, you can see the touch device (Cando Corporation...) is device id 13. To float that input device, run:

xinput float 13

NOTE: If you don't have xinput, you can install it on MeeGo by running:

zypper install xorg-x11-utils-xinput

Once you float the input device, it will no longer move the mouse pointer. To reattach it, run:

xinput reattach 13 2

'2' is the device ID for the 'Virtual core pointer' you are reattaching the device to.

To keep X from connecting a device to the core pointer when starting the system, you can add:

Option "SendCoreEvents" "false"

to the InputClass section for the device, for example you can place the following in /usr/share/X11/xorg.conf.d as 60-cando.conf:

Section "InputClass"
        Identifier "Cando Multi Touch Panel"
        MatchVendor "Cando"
        MatchDevicePath "/dev/input/event*"
        Driver "mtev"
        Option "SendCoreEvents" "false"
EndSection

meego packages you may need

To perform the above steps on this wiki, you may need to install the xinput utility:

zypper install xorg-x11-utils-xinput
Personal tools