Bug 5483 - [xmodmap] Mouse buttons not well recognized
Summary: [xmodmap] Mouse buttons not well recognized
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/Mouse (show other bugs)
Version: 6.9.0
Hardware: x86 (IA32) All
: high major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 11326 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-03 10:57 UTC by Alexandre Ahmim-Richard
Modified: 2018-06-12 19:09 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (30.11 KB, text/plain)
2006-01-03 11:06 UTC, Alexandre Ahmim-Richard
no flags Details

Description Alexandre Ahmim-Richard 2006-01-03 10:57:57 UTC
Here is the problem, I have a 7 buttons mouse (MS intellieye optical) and
xmodmap tells me that there is 11 buttons. The first 5 buttons are still usable.

In previous versions 6.8.2 I only had to remap buttons 6 7 to 4 and 5 with
xmodmap, in order to use properly this mouse.

I'm using debian unstable with this package version: xbase-clients 6.9.0.dfsg.1-1

Detailed problem:

Here is my xorg.conf:
Section "InputDevice"
    Identifier     "Configured Mouse"
        Driver         "mouse"
	Option         "CorePointer"
	Option         "Device" "/dev/input/mice"
	Option         "Protocol" "ExplorerPS/2"
	Option         "Emulate3Buttons" "False"
	Option         "Buttons" "7"
	Option         "ZAxisMapping" "6 7"
EndSection

xmodmap conf:
pointer = 1 2 3 6 7 4 5

xmodmap now outputs an error.
xmodmap:  commandline:1:  bad number of buttons, must have 11 instead of 7

xmodmap -pp confirms that:
There are 11 pointer buttons defined.

    Physical        Button
     Button          Code
        1              1
	2              2
	3              3
	4              4
	5              5
	6              6
	7              7
	8              8
	9              9
	10             10
	11             11

xmodmap says me that I've got 11 buttons on my mouse. Strange. I tried to
collect more informations using xev.
xev gave me something to play with, buttons 1, 2, 3, 6 and 7 are rightly
recognized. As before, 6 and 7 need to be remaped to 4 and 5.

But, button 4 (in the previous version) is now recognized as button 10 !
Button 5 is simply not recognized. 4 and 5 are my left and right special
buttons. 6 and 7 the wheel.

I tried to define Option "Buttons" "11" in xorg.conf and play around
with it, but this time xmodmap says me that I've got 16 buttons ! 
I can notice that the button 5 is this time recognized as button 12.

I tried to remap thoses crazy buttons with xmodmap and the help of xev,
but without any success.

A related bug https://bugs.freedesktop.org/show_bug.cgi?id=4212 was fixed, but
apparently, not totally.

Does anyone experienced the same problem ?
Is there any workaround ?
Comment 1 Alexandre Ahmim-Richard 2006-01-03 11:06:12 UTC
Created attachment 4223 [details]
Xorg log 

(**) Option "Buttons" "7"
...
(**) Configured Mouse: Buttons: 11
(II) XINPUT: Adding extended input device "Configured Mouse" (type: MOUSE)
...
(II) Configured Mouse: ps2EnableDataReporting: succeeded
Comment 2 Jeremy Messenger 2006-01-26 04:11:44 UTC
I am having a same issue here on FreeBSD 6.0-STABLE when our xorg has been 
updated to 6.9.0 recently in a few days ago. My mouse is IntelliMouse Optical 
USB and PS/2 Compatible (current using PS/2), which it only has 7 buttons but 
for some reason the xorg keep think that it has 11 buttons. The xorg wouldn't 
listen to my xorg.conf as I told that it has 7 buttons. The 11 buttons are 
causing my scroll wheel behaves a bit weird, if I want to scroll up (wheel) and 
it will ending up as two events at the same by scroll up + right click. My mouse 
configure looks like this.

====================================
Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option      "Protocol" "Auto"
	Option      "Device" "/dev/sysmouse"
	Option      "Buttons" "7"
	Option      "ZAxisMapping" "6 7"
	Option      "Emulate3Buttons" "false"
EndSection
====================================

A bit workaround for avoid an annoy of scroll up + right click, I had to add ~/.
Xmodmap like this below. I did tried to do only 7 numbers, but it wouldn't let 
me same as what Alexandre has shown above.

====================================
pointer = 1 2 3 8 9 4 5 6 7 10 11
====================================

But, it is still calling on two events and the scroll up now will behaving as 
scroll up + side button. It is better than scroll up + right click for now.

Here's what the xev looks like if I scroll up and down.

scroll up (only one time):
====================================
ButtonPress event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478018, (175,3), root:(180,83),
    state 0x10, button 6, same_screen YES

ButtonPress event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478018, (175,3), root:(180,83),
    state 0x10, button 7, same_screen YES

ButtonPress event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478018, (175,3), root:(180,83),
    state 0x10, button 4, same_screen YES

ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478018, (175,3), root:(180,83),
    state 0x810, button 4, same_screen YES

ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478702, (175,3), root:(180,83),
    state 0x10, button 6, same_screen YES

ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41478702, (175,3), root:(180,83),
    state 0x10, button 7, same_screen YES
====================================

scroll down (only one time):
====================================
ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41564959, (174,3), root:(179,83),
    state 0x10, button 6, same_screen YES

ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41564959, (174,3), root:(179,83),
    state 0x10, button 7, same_screen YES

ButtonPress event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41564959, (174,3), root:(179,83),
    state 0x10, button 5, same_screen YES

ButtonRelease event, serial 29, synthetic NO, window 0x2a00001,
    root 0x107, subw 0x0, time 41564959, (174,3), root:(179,83),
    state 0x1010, button 5, same_screen YES
====================================

In the Xorg.0.log has this.

====================================
(**) Option "Protocol" "Auto"
(**) Mouse0: Device: "/dev/sysmouse"
(**) Mouse0: Protocol: "Auto"
(**) Option "CorePointer"
(**) Mouse0: Core Pointer
(**) Option "Device" "/dev/sysmouse"
(**) Option "Buttons" "7"
(**) Option "Emulate3Buttons" "false"
(**) Option "ZAxisMapping" "6 7"
(**) Mouse0: ZAxisMapping: buttons 6 and 7
(**) Mouse0: Buttons: 11
[...]
(II) Mouse0: SetupAuto: hw.iftype is 4, hw.model is 0
(II) Mouse0: SetupAuto: protocol is SysMouse
====================================

If you need the full Xorg.0.log and xorg.conf too, just let me know.
Comment 3 Jeremy Messenger 2006-01-26 06:30:03 UTC
I have figured it out, if I backout xc/programs/Xserver/hw/xfree86/input/mouse/
mouse.c to revision 1.18 and it solved my problem. The revision 1.19 is cauing 
problem.

http://cvs.freedesktop.org/xorg/xc/programs/Xserver/hw/xfree86/input/mouse/
mouse.c?r1=1.18&r2=1.19&makepatch=1&diff_format=u

With the revision 1.18, here are the details with my very orignal xorg.conf that 
only use 5 buttons.

xorg.conf:
====================================
Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option      "Protocol" "Auto"
	Option      "Device" "/dev/sysmouse"
	Option      "ZAxisMapping" "4 5"
	Option      "Emulate3Buttons" "false"
EndSection
====================================

Xorg.0.log:
====================================
(**) Option "ZAxisMapping" "4 5"
(**) Mouse0: ZAxisMapping: buttons 4 and 5
(**) Mouse0: Buttons: 5
====================================

xev, scroll up (only one time):
====================================
ButtonPress event, serial 27, synthetic NO, window 0x1200001,
    root 0x107, subw 0x0, time 441845, (173,2), root:(897,158),
    state 0x0, button 4, same_screen YES

ButtonRelease event, serial 27, synthetic NO, window 0x1200001,
    root 0x107, subw 0x0, time 441845, (173,2), root:(897,158),
    state 0x800, button 4, same_screen YES
====================================

xev, scroll up (only one time):
====================================
ButtonPress event, serial 27, synthetic NO, window 0x1200001,
    root 0x107, subw 0x0, time 514895, (174,2), root:(793,62),
    state 0x0, button 5, same_screen YES

ButtonRelease event, serial 27, synthetic NO, window 0x1200001,
    root 0x107, subw 0x0, time 514895, (174,2), root:(793,62),
    state 0x1000, button 5, same_screen YES
====================================

I don't FreeBSD supports side buttons (never work) and I never need them, so 
change to 7 button details:

xorg.conf:
====================================
Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option      "Protocol" "Auto"
	Option      "Device" "/dev/sysmouse"
	Option      "Buttons" "7"
	Option      "ZAxisMapping" "6 7"
	Option      "Emulate3Buttons" "false"
EndSection
====================================

Xorg.0.log:
====================================
(**) Option "ZAxisMapping" "6 7"
(**) Mouse0: ZAxisMapping: buttons 6 and 7
(**) Mouse0: Buttons: 7
====================================

Finally, it respects xorg.conf's buttons option. As for the xev, it looks same 
as in my first comment #2.
Comment 4 Jeremy Messenger 2006-01-26 06:31:37 UTC
Looks like bugzilla doesn't like a long URL, so here's a short one.

http://tinyurl.com/comzf
Comment 5 Panagiotis Astithas 2006-02-04 01:08:48 UTC
I can verify that the last workaround by Jeremy Messenger fixed my mouse as well.
I'm also on FreeBSD 6-STABLE.
Comment 6 moose 2006-05-19 08:15:26 UTC
Jeremy's xorg-server-6.9.0_3 patch fixes the middle-click duplication problem with Logitech Optical 
Cordless Mouse MX1000 also in FreeBSD 6-STABLE (May 18th, 2006).

Optimally, this would have been fixed in the original source for the next release. Otherwise, this 
patch will have to be distributed as a FreeBSD patch.

Comment 7 Daniel Stone 2007-02-27 01:29:42 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 8 Jeremy Huddleston Sequoia 2012-01-02 20:14:40 UTC
*** Bug 11326 has been marked as a duplicate of this bug. ***
Comment 9 Adam Jackson 2018-06-12 19:09:26 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.