Taming the Cyborg R.A.T. 7 mouse under Linux

Finally it is here! My new and shiny gaming mouse is everything I ever hoped for…except if I try using it under Linux. Somehow it gets “stuck” in the first window, and I can’t use it without restarting X. At the moment of writing this post, there is still no official patch, even though the mouse has been out for more than half an year.

Anyway, to get it to play nice under Linux, all you have to do is to add this section to you xorg.conf file. You can do it by typing this in a terminal: sudo gedit /etc/X11/xorg.conf, and then pasting the following block of text at the bottom of the file.

Section "InputClass"
        Identifier "Mouse Remap"
        MatchProduct "Saitek Cyborg R.A.T.7 Mouse"
        MatchDevicePath "/dev/input/event*"
        Option "ButtonMapping" "1 2 3 4 5 6 7 2 9 10 11 12 0 0 0"
EndSection

Until an official patch is released, this hack should get your Cyborg RAT 7 to work under Linux.

Andrei

31 comments on “Taming the Cyborg R.A.T. 7 mouse under Linux

  1. OlekNo Gravatar on said:

    For RAT 7 this worked for me, and horizontal scroll does it’s job too.
    Put it into /etc/X11/xorg.conf.d/rat-7.conf (create the dir if not there)

    Section “InputClass”
    Identifier “Mouse Remap”
    MatchProduct “Saitek Cyborg R.A.T.7 Mouse”
    MatchDevicePath “/dev/input/event*”
    Option “ButtonMapping” “1 2 3 4 5 0 0 9 8 7 6 0 0 0 0″
    EndSection

  2. William BlankenshipNo Gravatar on said:

    This psudo worked for me. xorg.config did not exist for me and attempting to generate the file as mentioned above did not properly work. That being said, I managed to get it to work using the following method:

    mk /etc/X11/xorg.conf.d/
    cd /etc/X11/xorg.conf.d
    sudo gedit 910-rat.conf

    now put the following lines in the new file:

    Section “InputClass”
    Identifier “R.A.T.”
    MatchProduct “R.A.T.7|R.A.T.9″
    MatchDevicePath “/dev/input/event*”
    Option “Buttons” “17″
    Option “ButtonMapping” “1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17″
    Option “AutoReleaseButtons” “13 14 15″
    Option “ZAxisMapping” “4 5 6 7″
    EndSection

    now save the file and restart the computer. My mouse has been working for 5 hours without a problem and the z-axis scroll wheel works fine.

    My OS is Linux Mint 14 64-bit with the Cinnamon interface.

    If you want to take the -config route to generate a file, you need to kill the window manager like mentioned above. In Mint 14 this is accomplished by:

    CTRL-ALT-
    Login
    service mdm stop

    now follow the above instructions mentioned by Andrei to generate the file (mine failed, but it may work for you).

    Here is a list of the sources I used to get my procedures:
    http://community.linuxmint.com/tutorial/view/813
    http://forum.xbmc.org/showthread.php?tid=56006
    http://askubuntu.com/questions/4662/where-is-the-x-org-config-file-how-do-i-configure-x-there
    And the article on this page.

    Thanks for the tutorial! You pushed me in the right direction, without this guide I probably would have never gotten my mouse to work!.

  3. Rat 9 userNo Gravatar on said:

    I was trying this on my Rat 9 on Fedora 18 and couldn’t figure out why it worked in Fedora 16 but not 18. I found that I just had the name incorrect which was causing random chaos. Also with the Authors button mapping my back button became the middle mouse click. I tried modifying the button mapping in order 1 through 12 followed by the three zeros but strangely after restarting x (log out / in) the 8th placement automatically changed to “88888888″. I’m not entirely sure why that happened.. but its working now so I’m going to go with the “If its not broke, don’t fix it” attitude.

    Also while digging around in the web for a fix I stumbled across this web page that offers a program that will bind mouse buttons to commands such as volume control, launching programs, whatever. I haven’t tried it yet but it looks interesting. http://www.nongnu.org/xbindkeys/xbindkeys.html

    # Find the proper name
    egrep “Name|Handlers” /proc/bus/input/devices

    # Create xorg.conf or modify as root (file did not exists in a new Fedora 18 install), paste in the original authors fix
    # NB I use vi from a shell (konsole or terminal), for those new to it here is some info. Log in as root by typing su if needed. Use arrows to place cursor on the desired line, press capital D to delete text, highlight text from this web page, hit lower case i in your shell to go into insert mode, center click to paste the highlighted section, hit escape to go back into command mode so you can save, use :wq! to save. If you screw it up just use :q! to exit without saving and try again.

    su
    vi /etc/X11/xorg.conf

    # Modify the Match Product line
    MatchProduct “Mad Catz Mad Catz R.A.T.9 Wireless Mouse”

    # Modify the ButtonMapping line
    Option “ButtonMapping” “1 2 3 4 5 6 7 8 9 10 11 12 0 0 0″

    # log out / in to restart x and check the xorg.conf file
    cat /etc/X11/xorg.conf

    # Notice that it looks odd, test, fix, care or not depending on how curious or daring you are
    Option “ButtonMapping” “1 2 3 4 5 6 7 88888888 9 10 11 12 0 0 0″

  4. Pingback: MadCatza R.A.T 7 MMO Gaming Mouse issue.

  5. RAT 7 MMONo Gravatar on said:

    Hello, any1 can help me setup the RAT 7 MMO ? i can’t find any guide anywhere on the internet :( . Using Linux Mint 14. The thing is that this mouse has more buttons than any other. Here is the link http://www.cyborggaming.com/prod/mmo.htm. Any help would be apreciated.

  6. Martin van der WolfNo Gravatar on said:

    Heh, what a coincidence that the solution to my mouse problems under Fedora is supplied by someone I ran into on SWTOR. ;) Thanks for the solution Andrei.

  7. Simon-Pierre GingrasNo Gravatar on said:

    Thanks! It worked for me, under Ubuntu 12.04.

  8. Pingback: supershabam | Unbreaking Cyborg R.A.T.7 Mouse in Ubuntu 12.04

  9. I ran into a few issues using my Cyborg RAT5. Same kind of issues described here: oddly getting stuck, things like that. So, I added a nice little 20-cyborgrat5.conf in /etx/X11/xorg.conf.d with the supplied settings, with the MatchProduct changed to “Saitek”, since I only have the one Saitek peripheral.

    It all worked, until I realised that the back mouse button was being detected as button 2 (scroll wheel click) with xev. After hours of digging around confused, I finally realised the problem. The ButtomMapping option in the solution on this site purposely remaps button 8 (back) to button 2. Figuring this was done because of some oddity with the way the RAT7′s buttons are mapped internally, I changed it back to 8, restarted X, and it works! No more getting stuck, and the back/forward buttons work as they should.

    I just hope this helps anyone else with a RAT5 running into similar problems.

    For reference, here’s my 20-cyborgrat5.conf:

    Section “InputClass”
    Identifier “Mouse Remap”
    MatchProduct “Saitek”
    MatchDevicePath “/dev/input/event*”
    Option “ButtonMapping” “1 2 3 4 5 6 7 8 9 10 11 12 0 0 0″
    # CHANGFE THE 8 AFTER 7 BACK INTO A 2 IF IT BREAKS.
    EndSection

  10. Got mine at 50$ through http://www.whichgamingmouse.com/ hehe

  11. congrats on new mouse guys

  12. RAT9 in Debian Squeeze. This should work with horizontal scroll, but horizontal scroll doesn’t work because of Xorg. They list it as one of the common issues in the ZAxisMapping section.
    “horizontal movement may not always be detected by the current version of the XFree86 X servers, because there appears to be no accepted standard as to how the horizontal direction is encoded in mouse data.”

    Section “InputClass”
    Identifier “Saitek Cyborg R.A.T.9 Mouse”
    MatchIsPointer “on”
    MatchProduct “R.A.T.9|Saitek Cyborg R.A.T.9 Mouse”
    MatchVendor “Saitek|SAITEK”
    MatchDevicePath “/dev/input/event*”
    Option “Protocol” “auto”
    Option “Buttons” “17″
    Option “ButtonMapping” “1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 16 17″
    Option “ZAxisMapping” “4 5 10 11″
    Option “AutoReleaseButtons” “13 14 15″
    EndSection

  13. Michael TokayerNo Gravatar on said:

    Silly me, looks like “ZAxisMapping” is for scroll wheels and “XAxisMapping” and “YAxisMapping” are for touchpads. I’ll tinker with it a bit more and see if I can make horizontal scroll work.

  14. Michael TokayerNo Gravatar on said:

    Hey guys. For those who are trying to use the RAT9, not the RAT7, I just wrote this for Debian Squeeze 6.0.4. It seems to work fine, but still no horizontal scrolling. I checked the button map with xev and 10 and 11 are the horizontal scroll ones; 10 is right, 11 is leg, so I’m stumped as to why it doesn’t work. The rest is fine though. Enjoy

    Section “InputClass”
    Identifier “Saitek Cyborg R.A.T.9 Mouse”
    MatchIsPointer “on”
    MatchProduct “R.A.T.9|Saitek Cyborg R.A.T.9 Mouse”
    MatchVendor “Saitek|SAITEK”
    MatchDevicePath “/dev/input/event*”
    Option “Protocol” “auto”
    Option “Buttons” “21″
    Option “ButtonMapping” “1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 0 0 0 0 0 0″
    Option “ZAxisMapping” “4 5″
    Option “YAxisMapping” “10 11″
    Option “AutoReleaseButtons” “13 14 15″
    EndSection

  15. Ditto the roller mouse haha!

    Thanks!!

  16. RolandNo Gravatar on said:

    For debian squeeze and RAT7 Contagion:

    Section “InputDevice”
    Identifier “Saitek Cyborg R.A.T.7 Contagion”
    Driver “mouse”
    Option “Protocol” “auto”
    Option “Buttons” “17″
    Option “ButtonMapping” “1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 16 17″
    Option “ZAxisMapping” “4 5 6 7″
    Option “YAxisMapping” “10 11″
    EndSection

    But horizontal scrolling still dont working.

  17. A couple updates to this saga.

    “AutoReleaseButtons” has been added to xorg’s input class. For a fix that will survive dist upgrades, do the following:

    sudo mkdir /etc/X11/xorg.conf.d/
    cd /etc/X11/xorg.conf.d/
    sudo nano 910-rat.conf

    # add the following to the file

    Section “InputClass”
    Identifier “R.A.T.”
    MatchProduct “R.A.T.7|R.A.T.9″
    MatchDevicePath “/dev/input/event*”
    Option “Buttons” “17″
    Option “ButtonMapping” “1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17″
    Option “AutoReleaseButtons” “13 14 15″
    Option “ZAxisMapping” “4 5 6 7″
    EndSection

    https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/615892

  18. MichaelNo Gravatar on said:

    Wow, Thank you. Just bought this mouse (mainly for comfort) and was surprised that it didn’t work smoothly out of the box with Ubuntu 11.10 today 11 Nov 2011. Your fix above, got it going for me though!

    Thank you very much!,
    Mike

  19. I am can’t get this to work on linux mint. it says that the file does not exist.

  20. Hi,

    Let me see if I understand this correctly. First, you’re creating the xorg.conf file in your home dir. Then you add the InputClass section for the mouse in that file. Last, you try to copy the conf file into the appropriate dir in /etc. Is this correct?

    Why not follow the example I’ve provided and modify an existing xorg.conf file? For Debian/Ubuntu you could use: sudo dpkg-reconfigure xserver-xorg. In Fedora/Red Hat, you can try: Xorg -configure :1. For other Linux distros there should be a similar command (google your distro name and xorg configuration).

    Any way, I’d love to help but I need more information. Maybe you could describe what you’re doing step by step? Also, what distribution do you use (Debian/Ubuntu/Fedora/Gentoo…)?

  21. > sudo cp ~/xorg.conf.new /etc/X11/xorg.conf

    fails for me, it says the file doesn’t exist. I’ve been trying to get this working for a week. but i’m far from a linux pro so i’ve just been stumbling blindly. Any suggestions?

  22. Bjorn R JohansenNo Gravatar on said:

    This doesn’t work with the R.A.T 9 :(

  23. B.R.JohansenNo Gravatar on said:

    It doesn’t work with the R.A.T 9 :(

  24. _terry_No Gravatar on said:

    Thanks man – I was about to whip out the ps2 roller mouse, lol.
    Works perfectly. Do you know how I can program the buttons – for media control.

  25. DrewsberryNo Gravatar on said:

    hey, I just installed Linux a couple of hours ago, so bear with me please.
    I typed in the command but the file was empty. I typed in the code anyway and saved it but it didn’t work. What should I do?

    (Bear in mind I’ve had Ubuntu a good 3 or so hours and only just managed to figure out how to open the Terminal)

    • AndreiNo Gravatar on said:

      I think you might be missing the xorg.conf file, which in some cases is not uncommon. You just have to generate a new one. To do so, try these steps and follow the eventual instructions you see:

      1. Press Ctrl+Alt+F1 or Ctrl+Alt+F2.
      2. Login with your username and password.
      3. sudo /etc/init.d/gdm stop (this will stop the X server)
      4. cd /etc/X11
      5. sudo mv xorg.conf xorg.conf.notworking (this line might not apply in your case, but try it anyway)
      6. sudo X -configure
      7. sudo cp ~/xorg.conf.new /etc/X11/xorg.conf
      8. sudo /etc/init.d/gdm start

  26. Travis ScholzNo Gravatar on said:

    Thank you sooo much. i have a RAT 7 and this worked perfectly!

  27. tonibarNo Gravatar on said:

    Thanks ! I will try with my RAT 3. Some news about the patch?

    • AndreiNo Gravatar on said:

      Hi, unfortunately it seems that there won’t be any official patch coming any time soon. Let me know if this fix worked for your RAT 3.

      Andrei

Leave a Reply

Your email address will not be published. Required fields are marked *

*

     

HTML tags are not allowed.