Bug 2740

Summary: Razor Diamondback optical mouse, not all buttons working
Product: xorg Reporter: Martin Hoffmann <hm>
Component: Input/evdevAssignee: Zephaniah E. Hull <warp-spam+fdo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: ajax, esigra
Version: 6.8.2   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Martin Hoffmann 2005-03-15 10:54:59 UTC
The Razer Diamondback mouse does not fully work. 

It has 9 buttons: left, middle, right, mwheelup, mwheeldown, two buttons on the
left side and two buttons on the right side of the mouse.

With this xorg.conf configuration the following buttons do not work (meaning,
they do not produce events in xev): mwheelup, mwheeldown, both buttons on the
right side. But every button produces something when doing 'cat /dev/input/event1'

Section "InputDevice"
    Identifier "Mouse1"
    Driver     "mouse"
    Option "Protocol"    "evdev"
    Option "Dev Name"  "Razer Razer Diamondback Optical Mouse" 
    Option "Dev Phys"   "usb-0000:00:02.0-1/input0"
    Option "Device"      "/dev/input/event1"
    Option "Buttons"   "9"
    Option "ZAxixMapping" "8 9"
    Option "Resolution" "1600"
EndSection

If Windows (with the Razer windows drivers installed) is run before windows (and
rebooted not halted) the configuration above does work.

With this next following configuration all buttons produce an event in xev, but
mwheelup and and the front button on the right side produce the same event. Also
mwheeldown and the back button on the right side produce the same event.

Section "InputDevice"
    Identifier  "Mouse1"
    Driver "mouse"
    Option "Protocol"   "ExplorerPS/2"
    Option "Device"     "/dev/input/mice"
    Option "Buttons"    "9"
    Option "ZAxisMapping"       "8 9"
EndSection
Comment 1 Adam Jackson 2005-03-18 20:38:52 UTC
just for the record, the "evdev" protocol is not part of stock Xorg, and bugs with it should be filed with 
the patch's author.

in the second configuration, does it work if you say ZAxisMapping 4 5 instead?  that is, find the button 
events generated for each real button, and map the mouse wheel to the two that aren't used (probably 
either 4,5 or 6,7).
Comment 2 Martin Hoffmann 2005-03-21 04:02:18 UTC
I made some tests with different ZAxisMapping Settings, always using the second
comfiguration. 

For all the following tests, xev always showed the same events for these buttons:

Buttons:         event in xev:
left mouse       button 1
middle mouse     button 2
right mouse      button 3

Now the tests for different settings of ZAxisMapping. "frs" resembles the button
in the _F_ront (closer to the cable) of the two buttons on the _R_ight _S_ide of
the mouse. "brs" is the _B_ack button on the _R_ight _S_ide, and so on.

ZAxisMapping "4 5"

Buttons:         event in xev:
mwheelup         button 4
mwheeldown       button 5
brs              button 5
frs              button 4
bls              (no event)
fls              (no event)

ZAxisMapping "6 7"

Buttons:         event in xev:
mwheelup         button 6
mwheeldown       button 7
brs              button 7
frs              button 6
bls              button 4
fls              button 5

ZAxisMapping "8 9"

Buttons:         event in xev:
mwheelup         button 8
mwheeldown       button 9
brs              button 9
frs              button 8
bls              button 4
fls              button 5
Comment 3 Adam Jackson 2005-03-26 19:41:45 UTC
interesting.  just out of curiosity, what do you get when you don't specify any
ZAxisMapping?
Comment 4 Martin Hoffmann 2005-03-27 05:50:09 UTC
Without specifying ZAxisMapping, but with using Buttons "9", I get the same
results for left, middle and right mouse buttons. 

mwheelup, mwheeldown and both buttons on the right do not produce an event at
all in xev.
the back button on the left side produces "button 4" and the front button on the
left produces "button 5".

Without Buttons "9", only left, middle and right mouse buttons produce events.
All other buttons do not.
Comment 5 Martin Hoffmann 2005-06-08 13:52:10 UTC
Has there been any progress on this? 

If I can, I would like to help. Please tell me how!
Comment 6 A. Wenzel 2005-10-21 07:07:28 UTC
Hi!
I testet the Razer Mouse without X using evtest.
Here are my results:

evtest /dev/input/event1
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x1532 product 0x2 version 0x100
Input device name: "Razer Razer Diamondback Optical Mouse"
Supported events:
  Event type 0 (Reset)
    Event code 0 (Reset)
    Event code 1 (Key)
    Event code 2 (Relative)
  Event type 1 (Key)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
    Event code 275 (SideBtn)
    Event code 276 (ExtraBtn)
    Event code 277 (ForwardBtn)
    Event code 278 (BackBtn)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
Testing ... (interrupt to exit)
Event: time 1129900686.153430, type 1 (Key), code 272 (LeftBtn), value 1
Event: time 1129900686.153445, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900686.217418, type 1 (Key), code 272 (LeftBtn), value 0
Event: time 1129900686.217434, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900686.665335, type 1 (Key), code 273 (RightBtn), value 1
Event: time 1129900686.665351, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900686.729324, type 1 (Key), code 273 (RightBtn), value 0
Event: time 1129900686.729337, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900687.601161, type 1 (Key), code 274 (MiddleBtn), value 1
Event: time 1129900687.601174, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900687.689142, type 1 (Key), code 274 (MiddleBtn), value 0
Event: time 1129900687.689154, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900689.472807, type 1 (Key), code 276 (ExtraBtn), value 1
Event: time 1129900689.472824, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900689.568790, type 1 (Key), code 276 (ExtraBtn), value 0
Event: time 1129900689.568808, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900690.000710, type 1 (Key), code 275 (SideBtn), value 1
Event: time 1129900690.000726, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900690.080695, type 1 (Key), code 275 (SideBtn), value 0
Event: time 1129900690.080711, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900691.280471, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1129900691.280485, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900691.880358, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1129900691.880374, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900692.824180, type 2 (Relative), code 8 (Wheel), value 1
Event: time 1129900692.824194, type 0 (Reset), code 0 (Reset), value 0
Event: time 1129900693.248099, type 2 (Relative), code 8 (Wheel), value -1
Event: time 1129900693.248112, type 0 (Reset), code 0 (Reset), value 0

As you can see, the ForwardButton and BackButton are assigned as Wheel events.
Maybe the problem refers to the Kernel evdevmodul?
I hope work is going on here soon :)
bye
alex
Comment 7 Martin Hoffmann 2006-01-03 12:22:41 UTC
Happy New Year!

Any news on this issue?
Comment 8 Erik Andren 2006-05-31 01:50:43 UTC
what is the status of this bug using the current 1.1.2 evdev driver?
Comment 9 Martin Hoffmann 2006-07-01 23:34:13 UTC
(In reply to comment #8)
> what is the status of this bug using the current 1.1.2 evdev driver?

Sorry for my late response. I can currently not test this as I am not at home
for some time. The last version I tried (where it did not work) was 1.0.0.5.
Comment 10 Zephaniah E. Hull 2006-07-02 11:01:01 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > what is the status of this bug using the current 1.1.2 evdev driver?
> 
> Sorry for my late response. I can currently not test this as I am not at home
> for some time. The last version I tried (where it did not work) was 1.0.0.5.

1.0.0.5 is more then just hopelessly obsolete, it's broken too.

However looking at the report of the evtest results and seeing wheel events for
buttons, which changes after being run under windows, I start to suspect that
some kernel support for button configuration on this mouse might be useful.

Anyone feel like donating one of these beasts to the cause?

I'm also reassigning the bug over to the evdev component.

Zephaniah E. Hull.
Comment 11 Martin Hoffmann 2006-07-03 03:13:46 UTC
I was able to test the mouse after all with the latest evdev. Here are the results:

Relevant part of xorg.conf:
Section "InputDevice"
  Identifier  "Mouse1"
  Driver  "evdev"
  Option  "CorePointer"
  Option  "Buttons"    "9"
  Option  "ZAxisMapping"  "8 9"
  Option  "Device"  "/dev/input/event2"
EndSection

I was using =x11-drivers/xf86-input-evdev-1.1.2-r1 on gentoo linux. The results
from the buttons using xev are as follows:

left mouse = button 1
right mouse = button 3
middle mouse = button 2
mwheelup = button 4
mwheeldown = button 5
left side, front (closer to cable) = button 7
left side, back = button 6
right side, front (closer to cable) = button 4
right side, back = button 5

If you need any more information, please don't hesitate to ask.

BTW, I am willing to donate my personal mouse, if it's no problem that it was in
use already. I am not at home for a while and do not need it at the moment.
Anyway, I will get the latest 2000dpi mouse then 8-). Just tell me where to send it!
Comment 12 Zephaniah E. Hull 2006-07-03 03:44:18 UTC
(In reply to comment #11)
> I was able to test the mouse after all with the latest evdev. Here are the
results:
> 
> Relevant part of xorg.conf:
> Section "InputDevice"
>   Identifier  "Mouse1"
>   Driver  "evdev"
>   Option  "CorePointer"
>   Option  "Buttons"    "9"
>   Option  "ZAxisMapping"  "8 9"
>   Option  "Device"  "/dev/input/event2"
> EndSection
> 
> I was using =x11-drivers/xf86-input-evdev-1.1.2-r1 on gentoo linux. The results
> from the buttons using xev are as follows:
> 
> left mouse = button 1
> right mouse = button 3
> middle mouse = button 2
> mwheelup = button 4
> mwheeldown = button 5
> left side, front (closer to cable) = button 7
> left side, back = button 6
> right side, front (closer to cable) = button 4
> right side, back = button 5
> 
> If you need any more information, please don't hesitate to ask.
> 

It looks like razertool _might_ be able to set stuff under Linux as the Windows
driver does, though at first glance I'm not sure it will actually work with the
diamondback, nor do I see any way to bind a button action to actually report
actual mouse buttons 6 and 7.

If the windows drivers can do it, then clearly it's possible, and I'd be happy
to tackle trying to figure out how and making sure all the odd features work for
xf86-input-evdev.  I'm not entirely sure that moving the entire functionality
into xf86-input-evdev would be an overly good idea.

That said, if you're interested in such I could probably see my way to implement
 various evil device specific quirks (including at least the ability to try and
set a vaguely sane set of defaults for those buttons if asked to).

As a warning, anything more then an attempt at a basic 'make the DPI, HZ, and
buttons sane in a manner that may trash the windows configurations, and only if
I'm sure this looks right _and_ the user asks me to' as part of xf86-input-evdev
is going to have to wait a while, mostly because I am hopefully going to be
starting a contract to do other work on xf86-input-evdev shortly and I'd really
like to see about getting a sane reconfiguration interface for X drivers written
 first.

But if you're still interested in such after the advise and warnings, let me
know and I'll send you a mailing address via private email.
(I'm in the USA though.)

Zephaniah E. Hull.

> BTW, I am willing to donate my personal mouse, if it's no problem that it was in
> use already. I am not at home for a while and do not need it at the moment.
> Anyway, I will get the latest 2000dpi mouse then 8-). Just tell me where to
send it!

Comment 13 Zephaniah E. Hull 2006-07-13 09:05:12 UTC
What's the status on this?  Is everything working with current evdev and the
tool, or is more needed on this end?

Zephaniah E. Hull.
Comment 14 Martin Hoffmann 2006-07-13 12:45:56 UTC
(In reply to comment #13)
> What's the status on this?  Is everything working with current evdev and the
> tool, or is more needed on this end?
> 
> Zephaniah E. Hull.

Hi,

Actually, I don't really know how I should proceed now. I never heard of
_razortool_, at least I don't recall. A quick search for in on google.con/linux
didn't have any results. Is that the windows tool to configure the mouse?

If it is, how should I use it then? With wine? 

Have a nice evening,
Martin
Comment 15 Zephaniah E. Hull 2006-07-13 13:22:30 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > What's the status on this?  Is everything working with current evdev and the
> > tool, or is more needed on this end?
> > 
> > Zephaniah E. Hull.
> 
> Hi,
> 
> Actually, I don't really know how I should proceed now. I never heard of
> _razortool_, at least I don't recall. A quick search for in on google.con/linux
> didn't have any results. Is that the windows tool to configure the mouse?

Ah, no, sorry.  My apologies.
http://razertool.sourceforge.net/, it's a linux tool but it looks like they are
only trying to support the Copperhead.  Again, I'd be happy to try and implement
at least basic support for your mouse (and/or the Copperhead if it's close
enough), assuming that I have something similar enough to test with and to peer
at the protocol the windows tools use.

The interesting quandary is that the Copperhead may use a different
configuration protocol then the Diamondback, which would, ah, complicate matters
somewhat if you wanted to grab a Copperhead to replace the Diamondback.

But, again, I'd be willing to try for at least basic (all buttons work) support
for both.

Hope this helps.
Zephaniah E. Hull.
Comment 16 Martin Hoffmann 2006-08-17 12:52:26 UTC
Hi!

Some time passed since my last post...

I had some spare time today and tried out razertool-0.0.6. The program looks
good but unfortunately does not recognize the mouse at all. It seems to work
with copperheads only, I guess.

@ Zephaniah E. Hull: If you have other suggestions, please let me know.
Otherwise, are you still interested in the donation of my mouse?
Comment 17 Zephaniah E. Hull 2006-08-18 12:14:14 UTC
Yes, I'm still interested.

One note, I've got a contract right now that's eating most of my creative
energy, so it could be a little while before too much code gets generated.

Drop me a private email and I'll get you a shipping address and such.

Zephaniah E. Hull.
Comment 18 Timo Jyrinki 2007-02-22 14:28:23 UTC
Marking broken (status null/blank) bugs in xorg with no activity in a long time as fixed. Please reopen if you think it's necessary, but first do a search if a similar bug report is already filed and in a NEW/ASSIGNED state. These bugs do not currently show in most search results as they do not have any status.

Sorry for this janitorial spam, you know where to send hate mails to when your inbox gets full of bugs you're subscribed to.

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.