How to enable MPX on X11R7.5

Starting with X11R7.5, Xorg includes support for Multi-Pointer X. This allows the user to use multiple input devices simultaneously. Since there is a lack of easy-to-find documentation on the subject, I put together this little tutorial.

Let's say you're a laptop user, like me, and you want to have separate mouse pointers for your mouse and your touchpad. First, run xinput list. You will see something like this:

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Touchpad                                  id=6    [slave  pointer  (2)]
⎜   ↳ Mouse1                                    id=7    [slave  pointer  (2)]
⎜   ↳ Mouse1                                    id=9    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Keyboard0                                 id=8    [slave  keyboard (3)]
    ↳ Keyboard0                                 id=10   [slave  keyboard (3)]
    

As you see above, both the mouse and the touchpad are slaves of the Virtual core pointer. Lets create a new master, and put the touchpad there.

$ xinput create-master New
    

This should make a pointer appear on the screen. However, no device is attached to it yet. Run xinput list and look at the output:

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Touchpad                                  id=6    [slave  pointer  (2)]
⎜   ↳ Mouse1                                    id=7    [slave  pointer  (2)]
⎜   ↳ Mouse1                                    id=9    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Keyboard0                                 id=8    [slave  keyboard (3)]
    ↳ Keyboard0                                 id=10   [slave  keyboard (3)]
⎡ New pointer                                   id=11   [master pointer  (12)]
⎜   ↳ New XTEST pointer                         id=13   [slave  pointer  (11)]
⎣ New keyboard                                  id=12   [master keyboard (11)]
    ↳ New XTEST keyboard 
    

Now, you need to move the Touchpad to the new master. As you see above, Touchpad's id is 6. You want it do be moved from Virtual core pointer to New pointer, whose id is 11:

$ xinput reattach 6 11
    

Congratulations, now both your mouse and touchpad should have its own pointer!

Reverting back

As of the time of this writing, practically nothing works with MPX flawlessly, and you will probably encounter some annoying glitches especially if compositing is enabled. Once you're done playing with it, you probably want to revert back to "normal" without restarting X. Doing that is easy - you just have to reattach the device back to the Virtual core pointer and remove the master you created:

$ xinput reattach 6 2
$ xinput remove-master 11
    
Last modified: November 09 2009 22:38:16 GMT