I hate software

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 21 November 2013

Multitouch touchscreen support in OS X

Posted on 15:55 by Unknown
Hi there!

I happen to have a Dell S2340T multitouch monitor (quite an expensive toy btw) which has a touch controller from 3M. It works fine in Windows (which I don't have any plans to use), sort of works in linux (which is my primary work environment) and does not work at all in OS X (not a big deal but it would be cool to have it).

So I set out on the search for a driver and have figured out the following:

  • There is some old driver from TouchBase that sucks. I mean, it's using some stinky installer that pollutes the OS X root file system, it has the UI from 90s. More than that, it's not signed and does not support my touchscreen. Even adding the USB Vendor ID to its Info.plist did not fix a thing
  • There is some new trial driver from TouchBase that should work for most devices but is limited to 100 touches (a demo version). Well, I didn't want to grovel before them and sign up at their stupid site. And still, even if I patched the driver to remove the trial limitations, I would have to sign it with my certificate and there would be no legal way for me to distribute it on the internetz
  • There is a full version of the TouchBase driver that costs $100. Are they fucking crazy? On the other hand, I would do the same. See, home users don't care, multitouch displays are very rare, and people are used to pirating sofrware. But one could raise quite some money selling the driver to the workshops that build customized Apple computers (like ModBook) or car PCs.
  • There are some drivers for other touchscreens, but they're for the old single-touch devices

Doesn't look promising. Now, one may wonder "WTF ain't it working out of the box? It's a HID device, should work everywhere". Well, there are two problems:

  • Multitouch devices have the new HID event type (called HID usages) for the Digitizer class which the OS X does not support in IOKit.  Actually, since it uses a new HID class (different to single-touch monitors), it is not even classified as a touchscreen by the OS (rather as a multitouch trackpad)
  • The touchscreen gets recognized by the generic HID driver as a mouse. And here comes the problem - when a finger is released, the device reports the pointer to be at the origin (point <0, 0>) which causes the cursor to be stuck at the top left corner
I decided to learn about the HID system in OS X and write a driver. I started with the sample code from the HID documentation and added some event debugging. I found out that the device reports the events both as a digitizer and as a pointing device. So for now I prepared a demo app in Qt5 that can recognize multiple touches and draw points in different colors when the screen is touched. Have a look at it in action:


The source code is at https://github.com/astarasikov/osx-multitouch-demo .


Well, looks like I should figure out how to turn this into a device driver. I will probably need to figure out how to enumerate HID devices based on their class and make a kext file (Kernel EXTension) for XNU (the kernel used in OS X) and then.. sell my driver for some $20, right?
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • thoughts on modern operating systems
    For a long time I've been messing with low-level code on various embedded hardware. While I generally find linux kernel code an outstand...
  • An update on OSX Touchscreen driver
    After playing with the HID interface in OS X, I have found out there exists an API for simulating input events from user space, so I've ...
  • Why I adore Java NOT.
    Ok, here are some of my thoughts about Java as both a language and a development platform. TL;DR: when all you have is a hammer, everything ...
  • Doing it wrong: application preferences
    One thing that's been always bothering me is the lack of a unified way to keep persistent settings. When you're installing a shiny n...
  • KVM on ARM Cortex A15 (OMAP5432 UEVM)
    Hi! In this post I'll summarize the steps I needed to do in order to get KVM working on the OMAP5 ARM board using the virtualization ext...
  • Multitouch touchscreen support in OS X
    Hi there! I happen to have a Dell S2340T multitouch monitor (quite an expensive toy btw) which has a touch controller from 3M. It works fine...
  • Results of 2012 as seen from 2013
    This post is a couple hours late but my excuse is that I was having amazing holidays with my nearest and dearest and without the huge distra...
  • Mobile phones suck!
    Here we go again, another rant about mobile operating systems. I'm fed up with Android. But there's no alternative for me right now....
  • linux gone wrong
    I've been hacking on linux kernel for embedded hardware (mainly PDAs) for quite a while already and I'm sick to death of the bullshi...
  • Visions on Genode OS development
    Introduction This documents summarizes my visions of what and how could and should be improved about the Genode Operating System Framework i...

Blog Archive

  • ▼  2013 (14)
    • ▼  November (4)
      • KVM on ARM Cortex A15 (OMAP5432 UEVM)
      • An update on OSX Touchscreen driver
      • Multitouch touchscreen support in OS X
      • Using a hybrid graphics laptop on linux
    • ►  October (2)
    • ►  May (2)
    • ►  April (2)
    • ►  February (2)
    • ►  January (2)
  • ►  2012 (6)
    • ►  December (1)
    • ►  October (1)
    • ►  September (3)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile