Linux Input/HID development
 help / color / mirror / Atom feed
From: Pablo Cases <pablo.cases@flatfrog.com>
To: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: g_hid and hid-multitouch compatibility?
Date: Fri, 27 May 2011 17:33:26 +0200	[thread overview]
Message-ID: <8B252890F5150E47AD8B8AEC92FDBA2201118CAC80@fg-dc1> (raw)


Hi all,

I have searched the net and the archives of linux-input for information on how to use the Linux g_hid kernel module on a device and the hid-multitouch kernel module on a host to communicate multitouch events. But unfortunately I can only get single touch working. 

Q: Has anyone successfully completed a g_hid <-> hid-multitouch setup? And is there a description somewhere of such setup?
Q: Is the Windows 7 multitouch USB HID descriptor the correct one to use also for Linux hid-multitouch? Or is some tweaking necessary?

DETAILED DESCRIPTION BELOW
The device is a Linux device that uses g_hid (currently 2.6.37 kernel) and a USB HID Report Descriptor for multitouch using two-touch parallel mode according to Microsoft document http://msdn.microsoft.com/en-us/windows/hardware/gg487437. 

On the host (ubuntu 11.04, 2.6.38 kernel) I register dynamically according to the description at http://lii-enac.fr/en/architecture/linux-input/multitouch-ubuntu-howto.html. Using the events/rdesc files in debugfs on Ubuntu 11.04 I have validated the parsing of the report descriptor and the input reports.

Example multitouch input report from /sys/kernel/debug/hid/0003:xxxx:yyyy.0002/events looks correct:
report (size 14) (numbered) =  05 03 00 a5 12 32 0e 03 01 99 14 32 0e 02 
Digitizers.TipSwitch = 1 
Digitizers.InRange = 1 
Digitizers.ContactID = 0 
GenericDesktop.X = 4773 
GenericDesktop.Y = 3634 
Digitizers.TipSwitch = 1 
Digitizers.InRange = 1 
Digitizers.ContactID = 1 
GenericDesktop.X = 5273 
GenericDesktop.Y = 3634 
Digitizers.ContactCount = 2

The first touch in the report is correctly presented both on Windows and on Ubuntu 11.04 (using ENAC's mtdiag tool with a minor tweak to display data from all devices not just multitouch ones). I can see in the debugfs files that the data for the second touch data is correctly transferred and interpreted (see above), but the mapping to the linux input system seems a bit strange though (see below). My guess is that I have not been correctly registered as a multitouch device. I'm assuming this also because I cannot see any activity from the hid-multitouch module other than it being initialized when I connect my device (probably another reason for the needed tweak in mtdiag above).

Example mapping from /sys/kernel/debug/hid/0003:xxxx:yyyy.0002/rdesc that does not look entirely correct for the second touch:
Digitizers.TipSwitch ---> Key.Touch
Digitizers.InRange ---> Key.ToolPen
Digitizers.ContactID ---> Absolute.Misc
GenericDesktop.X ---> Absolute.X
GenericDesktop.Y ---> Absolute.Y
Digitizers.TipSwitch ---> Key.Touch
Digitizers.InRange ---> Key.ToolRubber
Digitizers.ContactID ---> Absolute.?
GenericDesktop.X ---> Absolute.Z
GenericDesktop.Y ---> Absolute.Rx
Digitizers.ContactCount ---> Absolute.?
Button.0001 ---> Key.LeftBtn
Button.0002 ---> Key.RightBtn
Button.0003 ---> Key.MiddleBtn
GenericDesktop.X ---> Relative.X
GenericDesktop.Y ---> Relative.Y
GenericDesktop.Wheel ---> Relative.Wheel


Regards,
Pablo Cases

-------------------------
Pablo Cases, M.Sc.
Development Engineer Software
FlatFrog Laboratories AB
Magistratsvägen 10
22643 Lund
Sweden
Tel: +46 708 393816
Mail: pc@flatfrog.com
Web: www.flatfrog.com
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2011-05-27 15:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 15:33 Pablo Cases [this message]
2011-05-27 16:09 ` g_hid and hid-multitouch compatibility? Benjamin Tissoires
2011-05-27 22:08   ` Pablo Cases
2011-05-27 22:41     ` Benjamin Tissoires
2011-05-30 16:11       ` Pablo Cases
2011-05-31 11:19         ` Benjamin Tissoires
2011-05-31 16:03           ` Pablo Cases
2011-05-31 16:55             ` Benjamin Tissoires
     [not found]               ` <35E4813F-ADBF-4988-A80E-6D4DC254AE22@flatfrog.com>
2011-06-01 17:21                 ` Benjamin Tissoires
2011-06-07  6:25                   ` Pablo Cases

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8B252890F5150E47AD8B8AEC92FDBA2201118CAC80@fg-dc1 \
    --to=pablo.cases@flatfrog.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox