Bug 16723 - SetPointerMapping prevents duplicate button mappings
SetPointerMapping prevents duplicate button mappings
Status: RESOLVED FIXED
Product: xorg
Classification: Unclassified
Component: Input/Mouse
unspecified
All All
: medium normal
Assigned To: Xorg Project Team
Xorg Project Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-15 09:16 UTC by James Ralston
Modified: 2011-03-03 02:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Ralston 2008-07-15 09:16:11 UTC
Note: I'm honestly 

I have a wheel mouse.  I want button 8 (the thumb button) to behave exactly as button 2 (the middle button). However, when I attempt to implement that behavior with xmodmap:

$ xmodmap -e "pointer = 1 2 3 4 5 6 7 2 9"

...I get an error:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  116 (X_SetPointerMapping)
  Value in failed request:  0x2
  Serial number of failed request:  9
  Current serial number in output stream:  9

This is because the protocol specification for SetPointerMapping says:

"A zero element disables a button.  Elements are not restricted in value by the number of physical buttons, but no two elements can have the same nonzero value (or a Value error results)."

In other words, this is BROKENBYDESIGN.

(Ironically, back in the ZAxisMapping days, as a side-effect of X not coping well with many-button mice, all buttons >5 seemed to function as button 2... which in this case, is exactly the behavior I want. So, in my view, this is actually a regression.)

This issue has come up before:

http://lists.freedesktop.org/archives/xorg/2006-July/016613.html
https://bugzilla.redhat.com/show_bug.cgi?id=305861

However, I can't see that anything came of the mailing list discussion.

If there is some project/effort that will shortly come to fruition that will finally remove the brain-damaged "you can't map multiple physical buttons to the same button", then please let me know, and I'll help that effort in any way I can.

Otherwise, I'm going to track down the code that implements this restriction and dike it out. That will necessitate my maintaining locally-modified versions of X, though, and I'd prefer not to do that. (The time I would spend maintaining locally-modified versions of X would be far better spent contributing to other open-source projects.)
Comment 1 James Ralston 2008-07-15 09:16:41 UTC
Note that none of the version options listed in the "Version" field of this bug seem to correspond to what I'm running, which is Fedora 9 + all available Fedora-provided updates:

xorg-x11-apps-7.3-3.fc9.x86_64
xorg-x11-drivers-7.3-4.fc9.x86_64
xorg-x11-filesystem-7.3-1.fc9.noarch
xorg-x11-font-utils-7.2-4.fc9.x86_64
xorg-x11-proto-devel-7.3-12.fc9.noarch
xorg-x11-resutils-7.1-5.fc9.x86_64
xorg-x11-server-common-1.4.99.905-1.20080701.fc9.x86_64
xorg-x11-server-utils-7.4-1.fc9.x86_64
xorg-x11-server-Xorg-1.4.99.905-1.20080701.fc9.x86_64
xorg-x11-twm-1.0.3-2.fc9.x86_64
xorg-x11-utils-7.4-1.fc9.x86_64
xorg-x11-xauth-1.0.2-4.fc9.x86_64
xorg-x11-xinit-1.0.9-1.fc9.x86_64
xorg-x11-xkb-utils-7.2-4.fc9.x86_64

If anyone knows how to map these versions to the appropriate choice in the "Version" field of this bug, please feel free...
Comment 2 Peter Hutterer 2008-07-15 17:00:12 UTC
On Tue, Jul 15, 2008 at 09:16:12AM -0700, bugzilla-daemon@freedesktop.org wrote:
> If there is some project/effort that will shortly come to fruition that will
> finally remove the brain-damaged "you can't map multiple physical buttons to
> the same button", then please let me know, and I'll help that effort in any way
> I can.
> 
> Otherwise, I'm going to track down the code that implements this restriction
> and dike it out. That will necessitate my maintaining locally-modified versions
> of X, though, and I'd prefer not to do that. (The time I would spend
> maintaining locally-modified versions of X would be far better spent
> contributing to other open-source projects.)

The X Input Extension specs claim the same. I would much prefer to fix this as
part of XI2 and just change the specs. Since so much other stuff changes, this
should be feasable. 

We can leave the core protocol untouched, and SetPointerMapping will be
deprecated sooner or later anyway.
Comment 3 Daniel Stone 2008-07-15 17:16:55 UTC
On Tue, Jul 15, 2008 at 05:00:12PM -0700, bugzilla-daemon@freedesktop.org wrote:
> --- Comment #2 from Peter Hutterer <peter.hutterer@who-t.net>  2008-07-15 17:00:12 PST ---
> On Tue, Jul 15, 2008 at 09:16:12AM -0700, bugzilla-daemon@freedesktop.org
> wrote:
> > If there is some project/effort that will shortly come to fruition that will
> > finally remove the brain-damaged "you can't map multiple physical buttons to
> > the same button", then please let me know, and I'll help that effort in any way
> > I can.
> > 
> > Otherwise, I'm going to track down the code that implements this restriction
> > and dike it out. That will necessitate my maintaining locally-modified versions
> > of X, though, and I'd prefer not to do that. (The time I would spend
> > maintaining locally-modified versions of X would be far better spent
> > contributing to other open-source projects.)
> 
> The X Input Extension specs claim the same. I would much prefer to fix this as
> part of XI2 and just change the specs. Since so much other stuff changes, this
> should be feasable. 
> 
> We can leave the core protocol untouched, and SetPointerMapping will be
> deprecated sooner or later anyway.

+1 for this plan.

(FWIW, the code is in dix/devices.c, and the check is trivial to
remove.)
Comment 4 Peter Hutterer 2008-07-21 00:58:59 UTC
xserver: pushed as 69de40ee45a6e046be79b735cd1540f63b87aee9.
xorg-docs: documentation pushed as 3fcc6b06b64535550ea95582d3d5d70fb6490ee9
Comment 5 Richard Klinda 2011-02-24 01:04:04 UTC
(In reply to comment #4)
> xserver: pushed as 69de40ee45a6e046be79b735cd1540f63b87aee9.
> xorg-docs: documentation pushed as 3fcc6b06b64535550ea95582d3d5d70fb6490ee9

Hello, i've the newest debian sid Xorg, and I cant remap button2 and button8 to behave as button2, i have the exact same problem as of the original bug reporter.  It used to work, but after I upgraded it is not.
Comment 6 Peter Hutterer 2011-02-27 16:26:48 UTC
(In reply to comment #5)
> Hello, i've the newest debian sid Xorg, and I cant remap button2 and button8 to
> behave as button2, i have the exact same problem as of the original bug
> reporter.  It used to work, but after I upgraded it is not.

did you use xmodmap or xinput set-button-map?
only the latter will work
Comment 7 Richard Klinda 2011-03-03 02:02:56 UTC
(In reply to comment #6)
> did you use xmodmap or xinput set-button-map?
> only the latter will work

You are right, setting it via xinput works, thank you.

The full command is (for googlers)

xinput --set-button-map 8 1 2 3 4 5 6 7 2