Bug 517782 - Unable to remap mouse buttons
Summary: Unable to remap mouse buttons
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-drv-evdev
Version: 11
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Peter Hutterer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-17 07:35 UTC by GV
Modified: 2018-04-11 16:28 UTC (History)
3 users (show)

Fixed In Version: 2.2.5-1.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 03:45:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Xorg log file - evdev version 2.2.1-3 (15.72 KB, text/plain)
2009-08-18 07:24 UTC, GV
no flags Details
Xorg log file - evdev version 2.2.4-1 (15.90 KB, text/plain)
2009-08-18 07:25 UTC, GV
no flags Details
Xorg log file - evdev version 2.2.4-2 (15.90 KB, text/plain)
2009-08-20 06:42 UTC, GV
no flags Details


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 23405 0 None None None Never

Description GV 2009-08-17 07:35:28 UTC
Description of problem:

Prior to xorg-11-drv-evdev-2.2.4-1 using xmodmap or xorg.conf mouse buttons can be remapped like this:

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

or in xorg.conf

Section "InputDevice"
       ....
       Driver      "evdev"
       Option      "ButtonMapping"     "1 2 3 4 5 6 7 3 2"
       ....
EndSection

Now this do not work anymore. This is very, VERY annoying. evdev should let me map mouse buttons as I want.

Yes, an error is reported then running xmodmap prior to xorg-11-drv-evdev-2.2.4-1:

Warning: Only changing the first 9 of 32 buttons.
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

But even with this error mouse pointers are mapped like I want. Now the same error is reported but nothing works anymore.

Version-Release number of selected component (if applicable):
org-11-drv-evdev-2.2.4-1

Comment 1 Matěj Cepl 2009-08-17 15:07:35 UTC

*** This bug has been marked as a duplicate of bug 502129 ***

Comment 2 Peter Hutterer 2009-08-18 06:00:48 UTC
[unduplicating, not the same issue.]

Has this ever worked? xmodmap should have always thrown that error and it's independent of evdev anyway. the X protocol spec states that "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)."

The issue here is that you're trying to assign button 2 to two different values. This doesn't work with xmodmap as it uses the core protocol. It is possible with the X input extension though.

xinput --set-button-map <device> ...

where device is either the name or the deviceid for the device. You can get it with xinput --list --short.



As for the xorg.conf issue, the button mapping code in evdev hasn't changed in over a year so something else must be involved. Can I have your log file and xorg.conf please?

Comment 3 GV 2009-08-18 07:24:33 UTC
Created attachment 357744 [details]
Xorg log file - evdev version 2.2.1-3

Comment 4 GV 2009-08-18 07:25:18 UTC
Created attachment 357746 [details]
Xorg log file - evdev version 2.2.4-1

Comment 5 GV 2009-08-18 07:38:46 UTC
(In reply to comment #2)

> Has this ever worked?
Yes. First time I did this I had redhat 9.

> The issue here is that you're trying to assign button 2 to two different
> values. This doesn't work with xmodmap as it uses the core protocol. It is
> possible with the X input extension though.
> 
> xinput --set-button-map <device> ...
>
> where device is either the name or the deviceid for the device. You can get it
> with xinput --list --short.
Just do a diff on the log files. The new evdev only see 3 buttons instead of 5:
 
< (II) Evoluent Mouse: Found 5 mouse buttons
---
> (II) Evoluent Mouse: Found 3 mouse buttons

# xinput --list --short | grep Evoluent
"Evoluent Mouse"        id=2    [XExtensionPointer]
# xinput get-button-map 2
1 2 3 4 5 6 7 

I think this is why xmodmap does not work anymore and same for xorg.conf. I had to switch back to old evdev package and block yum from upgrading it.

> As for the xorg.conf issue, the button mapping code in evdev hasn't changed in
> over a year so something else must be involved. Can I have your log file and
> xorg.conf please?  

Complete section from xorg.conf is:

Section "InputDevice"
        Identifier  "Evoluent Mouse"
        Driver      "evdev"
        Option      "SendCoreEvents" "true"
        Option      "Device" "/dev/input/by-id/usb-Kingsis_Peripherals_Evoluent_VerticalMouse_3-event-mouse"
        Option      "ButtonMapping"     "1 2 3 4 5 6 7 3 2"
EndSection

Log files are attached.

Comment 6 Peter Hutterer 2009-08-19 04:56:27 UTC
hah. tricky. Evdev counts the number of buttons based on the driver button mapping. you map physical buttons 4/5 to 3/2, so evdev only announces 3 buttons to the server.

when you then try to re-map those upper two buttons the server complains since you're trying to remap buttons that the driver claims it doesn't have. This is definitely a regression, thanks for spotting this.

I'm still surprised that the xmodmap command used to work, the protocol clearly states it should fail. The config section is definitively valid.

Upstreamed, see https://bugs.freedesktop.org/show_bug.cgi?id=23405

Comment 9 Peter Hutterer 2009-08-20 01:18:07 UTC
Please test the scratch build from:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1615980

if this works for you, I'll push the update into F11.

Comment 10 GV 2009-08-20 06:42:47 UTC
Created attachment 358047 [details]
Xorg log file - evdev version 2.2.4-2

Comment 11 GV 2009-08-20 06:45:33 UTC
(In reply to comment #9)
> Please test the scratch build from:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=1615980
> 
> if this works for you, I'll push the update into F11.  
Works. Now evdev seems to see 9 buttons. Thank you.

Comment 12 Fedora Update System 2009-08-20 23:43:05 UTC
xorg-x11-drv-evdev-2.2.5-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/xorg-x11-drv-evdev-2.2.5-1.fc11

Comment 13 Fedora Update System 2009-08-22 00:58:27 UTC
xorg-x11-drv-evdev-2.2.5-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update xorg-x11-drv-evdev'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8835

Comment 14 Fedora Update System 2009-09-10 03:45:45 UTC
xorg-x11-drv-evdev-2.2.5-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.