SetPointerMapping protocol braindeadedness

Egbert Eich eich at
Mon Jul 3 14:10:38 PDT 2006

Daniel Stone writes:
 > > 
 > > Would it be better to add a 'fixedSetPointerMapping' to XFIXES?
 > This is doable.

Right. The question is - should we bother? 
Retaining the old (sometimes broken) protocol behavior as much
as possible seems to be the way to go to ensure that those of the
tons of legacy apps that may need the old behavior continue to 

 > >  > > Does anyone know why this restriction was enforced in the protocol,
 > >  > > and/or have any objections to this change?
 > > 
 > > Was probably added to prevent you from loosing mouse buttons by accidental
 > > remapping. 
 > Yay for the protocol second-guessing the user.

Right of hand I can't see any other reason.

 > >  > In case you're curious: someone asked me how to make his under-thumb
 > >  > button (8) behave like the middle button (3) and have them both work
 > >  > as paste.  I didn't have a good answer.
 > > 
 > > There are more issues which involve the DDX: With SendCoreEvens one can
 > > make another input device send core mouse events. SetPointerMapping
 > > of course acts only on the 'real' core mouse. So if you do a remapping
 > > it does not efect the other input devices.
 > > Now one could argue that this is the intended behavior as remapping is
 > > per physical device and not per device class - however from client side
 > > there is no way to detect which input device also sends core events
 > > - not even thru the ill designed xf86misc extension.
 > > It would be easy to add this as another wart to this extension.
 > The real fix is to get rid of this bizzare SendCoreEvents mess once and
 > for all.  I have a working implementation[0] of this, which also adds
 > input hotplug, that I'm just waiting on approval to release.
 > Then we can just either:
 > a) ignore core SetPointerMapping events and only listen for Xi events,
 >    as the core pointer is now a virtual aggregator, or
 > b) propagate core SPMs down to the invidiual pointers.

I'd opt for a mixture of a and b to retain the old behavior as much 
as possible:
Aggregate XInput pointers to a core pointer and use SetPointerMapping
to do an overall remapping of the core pointer buttons after they have
been processed by the device specific layer.
Allow to change the button order on individual devices using an Xi
This allows to use SetPointerMapping to change the button order
on a mouse from left to right as some people do uniformely accross
all mice, while the other request allows for  more fine grained
adjustments on the individual devices.
SetPointerMapping would then only affect the core events - not the
Xi events.
This would allow old applications to continue to work as expected.


More information about the xorg mailing list