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!

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. @Kevin: All screencasting software has to be modified to take into account several pointers in their “record pointer” feature, that’s mostly it

  3. 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 Do you have an idea how to distinguish that?

  4. @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 :P

  5. @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 :(

Comments are closed.

Leave a Reply

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