-
Notifications
You must be signed in to change notification settings - Fork 10
R.A.T 9 USB Documentation
You may need to edit your xorg.conf file. To do so, just
sudo nano /etc/X11/xorg.confor open it in your favorite editor (with correct access rights) And append to it :
Section "InputClass"
Identifier "Mouse Remap"
MatchProduct "Saitek Cyborg R.A.T.9 Wireless Mouse"
MatchDevicePath "/dev/input/event*"
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 7 6 12 0 0 0 16 17 18 19 20 21"
EndSection
This will remap the mouse's buttons, allowing you to make use of the horizontal scrollwheel (a must !), and disable the mode button, which usually behaves like it's always on, and confuses X11, which causes freezes, lags, unresponsiveness, etc...
All the "extra" functionality of this mouse is handled with USB control URBs.
Here is some information in case someone else wants to implement it.
These are confirmed to work for the following devices (visible in lsusb):
06a3:0cfa
06a3:0cd9
Confirmation is pending for the 0738:1709 R.A.T.9.
bmRequestType: 0xc0
bRequest: 144
wValue: 0x0000
wIndex: 186
wLength: 2
The first eight bits in the response indicate the battery level
There are four sensibility modes (with IDs 1,2,3,4, from the —by default— lowest one to the highest one).
bmRequestType: 0xc0
bRequest: 144
wValue: 0x0000
wIndex: 116
wLength: 1
The first hexadecimal character is the current mode number. You can also find it by casting the response into a char, and then divide it by 16, or 0x10.
Actually, a bit like the previous one, excepted that this time, we don't read anything
bmRequestType: 0x40
bRequest: 145
wIndex: 116
wLength: 0
wValue: 0x1000
or 0x2000
or 0x3000
or 0x4000
Depending on the mode
This one is actually a bit different, and comes in two parts, just like the other Set DPI packets.
- Reset packet :
bmRequestType: 0x40
bRequest: 145
wValue: 0x0000
wIndex: 115
wLength: 0
- Confirmation packet :
bmRequestType: 0x40
bRequest: 145
wValue: 0x0051
wIndex: 112
wLength: 0
This one also comes in two parts :
- Part one :
bmRequestType: 0x40
bRequest: 145
wIndex: 115
wLength: 0
wValue: 0x1000 * mode
+ 0x01000 * axis (1 for x, 2 for y)
+ dpi ( (dpi-100)/25, to be exact, between 0x00 and 0xdc for a 5600dpi sensor
- part two (Confirmation packet, same as before) :
bmRequestType: 0x40
bRequest: 145
wValue: 0x0051
wIndex: 112
wLength: 0
```
Get current DPI settings
------------------------
bmRequestType: 0xc0
bRequest: 144
wValue: 0x0000
wLength: 2
wIndex: 0x1000 * mode
+ 0x01000 * axis (1 for x, 2 for y)
+ 0x0073
value obtained is (dpi-100)/25, and can be found in the second byte transferred.