Logitech G7 and NanoVx mice in Lenny

IntnsRed's picture

Hardware: 

Software: 

1.Out the box basic mice functions will work, great! Point and click I didn't even change xorg.conf.
--Picked up by the usual 'mouse' driver and usb setup.
--The hardware 3 step res works fine.

2.Try:
$>xev
and click the thumb and tilt wheels while over the window to see what is detected and as what button number.

3.Ah the tilt buttons...I have actually had this mouse since using Sarge, I can't believe that this is still not automgically setup and the user just picks what they want the buttons to do! How many millions of multibutton mice must be out there by now? Perhaps I'm missing something really simple but the following works for me.

4.The good news is that everything is now readily available it just needs some good ol' hacking, and it's very satisfying when it works.

######################################################################
The receiver actually registers as two usb devices which is where part of the difficulty lies. Also you'll notice they they both have the same "Name=" and my logitech keyboard also registers as two more devices (with the same name again) so I have four of these in the output. Hence using name later is useless as a unique identifier.

$> cat /proc/bus/input/devices |less

I: Bus=0003 Vendor=046d Product=c51a Version=0111
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:03.1-1/input0
S: Sysfs=/class/input/input1
U: Uniq=
H: Handlers=mouse1 event1
B: EV=17
B: KEY=ffff0000 0 0 0 0
B: REL=143
B: MSC=10

I: Bus=0003 Vendor=046d Product=c51a Version=0111
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:03.1-1/input1
S: Sysfs=/class/input/input2
U: Uniq=
H: Handlers=kbd event2
B: EV=1f
B: KEY=37fff002c3027 bf00444400000000 1 f848a27c000 667bfad9415fed 8e000000000000 0
B: REL=40
B: ABS=100000000
B: MSC=10

######################################################################
/etc/udev/rules.d/010_local.rules

KERNEL=="event[0-9]*", SYSFS{idProduct}=="c51a", SYSFS{idVendor}=="046d", SYSFS{../phys}=="usb-*/input0", SYMLINK+="g7"

Create the file as a text file if it does not exist or add the line if it does. This creates a sym link to the correct device every time the mouse is plugged in. Customise to fit your mouse, the point is to uniquely identify the correct device and sym link to the automatically created event#. The following is for a Nano VX:
KERNEL=="event[0-9]*", SYSFS{idProduct}=="c521", SYSFS{idVendor}=="046d", SYSFS{../phys}=="usb-*/input0", SYMLINK+="nanovx"

Be aware that there is a logitechmouse.rules none of these rules applied to me so I didn't look any further. A unplug/plug should cause the sym link to be created:
$> ls /dev |grep g7
or:
$> ls /dev |grep nano
######################################################################
/etc/X11/xorg.conf

Section "InputDevice"
Identifier "LogitechG7"
Driver "evdev"
Option "Device" "/dev/g7"
Option "Buttons" "8"
Option "ZAxisMapping" "4 5 7 8"
Option "SendCoreEvents"
Option "CorePointer"
EndSection

or for the nanovx:

Section "InputDevice"
Identifier "LogitechNanoVx"
Driver "evdev"
Option "Device" "/dev/nanovx"
Option "Buttons" "9"
Option "ZAxisMapping" "4 5 7 8 9"
Option "SendCoreEvents"
Option "CorePointer"
EndSection

######################################################################
/home/user/.xbindkeysrc

"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
m:0x0 + b:6
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
m:0x0 + b:7
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Up]""
m:0x0 + b:8

or for the nanovx:

#"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
# m:0x0 + b:6
#"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
# m:0x0 + b:7
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
m:0x0 + b:8
"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
m:0x0 + b:9

The spacing quotation marks and new lines (6 of) must all be retained exactly as above.
Of course if you just want to use the thumb button (8) mapped to your choice of command most likely "\[Alt_L]\[Left]"" for -back- in your browser use:

"/usr/bin/X11/xvkbd -xsendevent -text "\[Alt_L]\[Up]""
m:0x0 + b:8

Also of course for this to work:
#> aptitude install xvkbd xbindkeys
######################################################################
/home/user/.kde/Autostart/xmodscript

#!/bin/sh
#Logitech G7 mouse bindings see ~/.xbindkeysrc
xbindkeys

Create an executable script to start xbindkeys when kde starts, or place in your window managers startup scripts or
$>xbindkeys
######################################################################

Restart X, unplug/plug etc and crosss your fingers Smile
Well after all that a very slick mouse that performs well once you get used to using short quick taps in the tilt buttons to only get 1 click not 3 Wink Have fun.