More multitouchy fun

Sorry, nothing related to sex! Since my previous post, I didn’t actually hack much on getting MPX working, mostly blocking on the lack of ideas about a good API. That was until ImendioConf, where a talk with Richard about the subject made ideas start flowing, so here’s my late christmas present!

http://github.com/garnacho/gtk-mpx/tree/mpx

Besides making GDK use XInput 2.0, The main change is at the GtkWidget level, I’ve introduced GtkDeviceGroup and the “multidevice-event” signal. GtkDeviceGroup is just a container for GdkDevices, each widget can have several GtkDeviceGroups. The “multidevice-event” reports grouped motion events for the devices contained in a GtkDeviceGroup, it also provides hints about the latest event that happened and whether a device was just added,removed or updated.

The idea is, a widget would add devices to a group on button-press, enter-notify… remove them on button-release, leave-notify… and would get grouped motion events for all these devices in between. In the repo there are also a couple of test apps to show this working.

Obviously, there are quite some things left, I’ve collected missing stuff I’ve identified in the wiki, so if you feel curious about multitouch, compile xorg and help out!

And now of course, some videos of the examples 🙂

16 thoughts on “More multitouchy fun”

  1. My religion forbids me compiling code for my own personal use or installing it aside from apt. Any chance of a .deb?

  2. @ethana2: that would also involve making debs for xorg head, something that I really didn’t have in mind, given I’m a downstream guy who doesn’t know anything about packaging 🙂

    @Vincent: feeling like doing some paper and scissors hacking? :P, http://youtube.com/watch?v=pQpr3W-YmcQ (Actually, an xorg driver would also be necessary…)

  3. @Kevin: All screencasting software has to be modified to take into account several pointers in their “record pointer” feature, that’s mostly it

  4. Oh, hey, a “GTK + X input” hacker! Sorry that this is offtopic, but maybe you could give me a hint for this: when handling a mouse button event in GTK, is there a way to discover from which device the event came? There are several places in Gnome desktop where mousewheel events from a touchpad should be ignored while mousewheel events from a real mouse should be used (for example http://bugzilla.gnome.org/show_bug.cgi?id=402528). Do you have an idea how to distinguish that?

  5. @Kevin: Yeah, of course, but I tend to think in that as the topping, there are more important things to fix before. Or maybe I suck at marketing and that should have been the very first step 😛

  6. @oliver: Hmm, I fear you can’t distinguish devices as you want, with stock GTK+ (xinput disabled), it will be always the “core pointer” that generated all mouse events, that situation doesn’t change with currently available XInput.

    In XInput 2.0, you have master devices (or MD, that is, pointers on the screen) and slave devices (or SD, phisical mice, touchpads…), several SD can be attached to a MD, and widgets get events from MDs, which makes things tricky.

    There is XDeviceClassesChangedEvent, which is sent when the SD sending through the MD changes, and GTK+ could listen to this, but event->device would still point to the MD. So there’s no straighforward solution 🙁

  7. couldn’t someone hack a driver to connect mpx to reacTIVision framework?
    i think i read something regarding this some time on the old mpx website.
    this kind of tables are easy to setup and cheap.
    http://mtg.upf.es/reactable/?software
    i’d love to get one working with mpx 😛

Leave a Reply

Your email address will not be published. Required fields are marked *