Madcatz R.A.T.5 Mouse on Debian 7 Freezes – Fixed
How to Fix Freeze Problem When Using Madcatz R.A.T.5 on Debian Wheezy
The Problem: the RAT5 mouse gets “stuck” in one window, or freezes entirely. The only way to get unstuck seems to be toggling the Mode button (the blue/red/purple button just to the left of the left button – index finger). Even when that gets you unstuck, it will happen again, and seems to progressively get worse with time. (it seems to take a few minutes until you experience the first freeze)
sudo vi /etc/X11/xorg.conf.d/40-rat5.conf
Section "InputClass"
Identifier "Mad Catz R.A.T. 5"
MatchProduct "Mad Catz Mad Catz R.A.T.5 Mouse"
MatchDevicePath "/dev/input/event*"
Option "Buttons" "21"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 0 0 0 0 0"
Option "ZAxisMapping" "4 5 7 6"
EndSection
*** but wait! all this may not work for you in the end. So hopefully the method illustrated here will help you arrive at a happy conclusion as it did for me.
Here is how we get the button mapping:
STEP 1 : First we need the RAT5 mouse button map:
sudo xev
A window with the “event box” will appear. Position the console and this window so you can easily see them both. (Try to) Hold your mouse in motionless so it does not move and use/click the buttons and wheel. You will see the button number as you click/wheel. If the mouse moves, its almost impossible to see the button #. Here is what you are looking for:
ButtonRelease event, serial 37, synthetic NO, window 0x2600001,
root 0x283, subw 0x2600002, time 2971956, (34,38), root:(35,129),
state 0x810, button 4, same_screen YES
Write the RAT5 button map numbers down as follows:
(ie. my Madcatz RAT5)
1 – left click
2 – middle click
3 – right click
4 – wheel up
5 – wheel down
6 –
7 –
8 – back
9 – forward
10- wheel right
11- wheel left
12- Precision Aim
13- mode 1
14- mode 2
15- mode 3
16- DPI up
17- DPI down
STEP 2 : Next we need the ID of the RAT5 mouse
sudo xinput -list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Mad Catz Mad Catz R.A.T.5 Mouse id=9 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ PS/2 Generic Mouse id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Video Bus id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ ACPI Virtual Keyboard Device id=13 [slave keyboard (3)]
↳ Dell WMI hotkeys id=14 [slave keyboard (3)]
STEP 3 : Next we need the Button Labels as Debian has them:
sudo xinput watch-props 9
(replace the (9) ID number with the id of your mouse)
Device 'Mad Catz Mad Catz R.A.T.5 Mouse':
Device Enabled (143): 1
Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (269): 0
Device Accel Constant Deceleration (270): 1.000000
Device Accel Adaptive Deceleration (271): 1.000000
Device Accel Velocity Scaling (272): 10.000000
Device Product ID (259): 1848, 5893
Device Node (260): "/dev/input/event1"
Evdev Axis Inversion (273): 0, 0
Evdev Axes Swap (275): 0
Axis Labels (276): "Rel X" (153), "Rel Y" (154), "Rel Vert Wheel" (268)
Button Labels (277): "Button Left" (146), "Button Middle" (147), "Button Right" (148), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152), "Button Side" (263), "Button Extra" (264), "Button Forward" (265), "Button Back" (266), "Button Task" (267), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262), "Button Unknown" (262)
Evdev Middle Button Emulation (278): 0
Evdev Middle Button Timeout (279): 50
Evdev Third Button Emulation (280): 0
Evdev Third Button Emulation Timeout (281): 1000
Evdev Third Button Emulation Button (282): 3
Evdev Third Button Emulation Threshold (283): 20
Evdev Wheel Emulation (284): 0
Evdev Wheel Emulation Axes (285): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (286): 10
Evdev Wheel Emulation Timeout (287): 200
Evdev Wheel Emulation Button (288): 4
Evdev Drag Lock Buttons (289): 0
We only want the Button Labels, so we lay them out like so:
Button Labels (277):
1 – “Button Left” (146),
2 – “Button Middle” (147),
3 – “Button Right” (148),
4 – “Button Wheel Up” (149),
5 – “Button Wheel Down” (150),
6 – “Button Horiz Wheel Left” (151),
7 – “Button Horiz Wheel Right” (152),
8 – “Button Side” (263),
9 – “Button Extra” (264),
10 -“Button Forward” (265),
11- “Button Back” (266),
12- “Button Task” (267),
13- “Button Unknown” (262),
14- “Button Unknown” (262),
15- “Button Unknown” (262),
16- “Button Unknown” (262),
17- “Button Unknown” (262),
18- “Button Unknown” (262),
19- “Button Unknown” (262),
20- “Button Unknown” (262),
21- “Button Unknown” (262)
STEP 4 – Put it all together – Take the map positions from our Step #1, and put the Button Label numbers from Step #3 into position like so:
1 – left click – 1 – “Button Left” (146),
2 – middle click – 2 – “Button Middle” (147),
3 – right click – 3 – “Button Right” (148),
4 – wheel up – 4 – “Button Wheel Up” (149),
5 – wheel down – 5 – “Button Wheel Down” (150),
6 –
7 –
8 – back – 11- “Button Back” (266),
9 – forward – 10 -“Button Forward” (265),
10- wheel right – 7 – “Button Horiz Wheel Right” (152),
11- wheel left – 6 – “Button Horiz Wheel Left” (151),
12- Precision Aim – 8 – “Button Side” (263),
13- mode 1
14- mode 2
15- mode 3
16- DPI up
17- DPI down
Option "ButtonMapping" "1 2 3 4 5 0 0 11 10 7 6 8 0 0 0 0 0 0 0 0 0"
Step 1 gave us the positions of the function
Step 3 gave us the functions to match into position
The DPI is saved in the mouse and works fine. It can be adjusted in Windows using the ST software.
STEP 5 > In spite of everything above, forward & back buttons were dead, and the 8 button became the back button! No ideas why. So:
I read that the Option “AutoReleaseButtons” “13 14 15” did nothing and removing also had no impact for me.
I “passed-through” the offending buttons (8 9 12) to settle on this.
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 0 0 0 0 0"
Now the Forward and Back buttons work. The Side Button 12 is still dead, but then it has no official function for me anyway.
—————————————
This is what I gathered originally from other searches online. But it didn’t work for me. Seems everyone has a unique situation.
Section "InputClass"
Identifier "Mad Catz R.A.T. 5"
MatchProduct "Mad Catz Mad Catz R.A.T.5 Mouse"
MatchDevicePath "/dev/input/event*"
Option "Buttons" "21"
Option "ButtonMapping" "1 2 3 4 5 0 0 11 10 7 6 8 0 0 0 0 0 0 0 0 0"
Option "ZAxisMapping" "4 5 7 6"
Option "AutoReleaseButtons" "13 14 15"
EndSection
—————————————